Question
TrackableBehaviour / ObserverBehaviour could not be found
Vuforia can track my target image, but I'd like to add a component (new C# script) to the Image target object, such that it waits 3 seconds upon finding the image, and then randomly places one of the 3d (child) objects
Unfortunately, the console shows the error TrackableBehaviour / ObserverBehaviour could not be found. How can this be done in Unity6?
Delay.cs
using UnityEngine;
using Vuforia;
public class Delay : MonoBehaviour, ITrackableEventHandler
{
private TrackableBehaviour mTrackableBehaviour;
public GameObject childObject;
void Start()
{
mTrackableBehaviour = GetComponent<TrackableBehaviour>();
if (mTrackableBehaviour)
{
mTrackableBehaviour.OnTargetStatusChanged += OnTrackableStateChanged;
}
}
public void OnTrackableStateChanged(StatusChangeResult statusChangeResult)
{
if (statusChangeResult.NewStatus == Status.TRACKED)
{
StartCoroutine(PlaceObjectAfterDelay());
}
}
IEnumerator PlaceObjectAfterDelay()
{
yield return new WaitForSeconds(3);
Vector3 randomPosition = new Vector3(Random.Range(-0.5f, 0.5f), 0, Random.Range(-0.5f, 0.5f));
childObject.transform.localPosition = randomPosition;
}
}

