"We offer new support options and therefor the forums are now in read-only mode! Please check out our Support Center for more information." - Vuforia Engine Team

when image is detected, trigger scene change!

first, i'm never been using Unity program until one week ago...

----------------------------------------------------------------- using UnityEngine.SceneManagement; using UnityEngine; using System.Collections;

public class BaseScript : MonoBehaviour {

private static BaseScript instance = null;

public static BaseScript Instance { get { if (instance == null) {

instance = FindObjectOfType(typeof(BaseScript)) as BaseScript;

if (instance == null) {

GameObject obj = new GameObject("BaseScript"); instance = obj.AddComponent(typeof(BaseScript)) as BaseScript; } }

return instance; } } public void SetSceneName(string _name) { SceneManager.LoadScene(_name); }

void OnApplicationQuit() { instance = null; }

// Use this for initialization void Start() { DontDestroyOnLoad(this); }

// Update is called once per frame void Update() { } } i made sigleton C# file (BaseScript) ------------------------------------------------------------------------- public void OnTrackableStateChanged( TrackableBehaviour.Status previousStatus, TrackableBehaviour.Status newStatus) { if (newStatus == TrackableBehaviour.Status.DETECTED || newStatus == TrackableBehaviour.Status.TRACKED || newStatus == TrackableBehaviour.Status.EXTENDED_TRACKED) { OnTrackingFound(); BaseScript.Instance.SetSceneName(Component.name);

} public void OnTrackableStateChanged( TrackableBehaviour.Status previousStatus, TrackableBehaviour.Status newStatus) { if (newStatus == TrackableBehaviour.Status.DETECTED || newStatus == TrackableBehaviour.Status.TRACKED || newStatus == TrackableBehaviour.Status.EXTENDED_TRACKED) { OnTrackingFound(); BaseScript.Instance.SetSceneName(Component.name);

} and this is context on DefaultTrackableEventHandler

----------------------------------------------------------------------------------------

i wonder why compile error is occurred (An object reference is required to non access non-static member 'UnityEngine.Object.name')

and what 'Component.name' is

 

Make a new script like below and add to your image target or whatever. So it overrides the default tracking behaviour.

 

This is pseudo code!

----------------------------------