Hi all,
I am currently trying to figure out the best practice to get a sound file to play when the image target is tracked and the model spawns. Does the API have a boolean method that detects when the object has been loaded? I haven't been able to find one as of yet.
-Emmanuel
Hi,
Sure, I am referring to the DefaultTrackableEventHandler.cs script. This script provides among other things, also the Debug information that you would see in the console, when tracking an object.
public void OnTrackableStateChanged(
TrackableBehaviour.Status previousStatus,
TrackableBehaviour.Status newStatus)
{
m_PreviousStatus = previousStatus;
m_NewStatus = newStatus;
Debug.Log("Trackable " + mTrackableBehaviour.TrackableName +
" " + mTrackableBehaviour.CurrentStatus +
" -- " + mTrackableBehaviour.CurrentStatusInfo);
if (newStatus == TrackableBehaviour.Status.DETECTED ||
newStatus == TrackableBehaviour.Status.TRACKED ||
newStatus == TrackableBehaviour.Status.EXTENDED_TRACKED)
{
OnTrackingFound();
}
else if (previousStatus == TrackableBehaviour.Status.TRACKED &&
newStatus == TrackableBehaviour.Status.NO_POSE)
{
OnTrackingLost();
}
else
{
// For combo of previousStatus=UNKNOWN + newStatus=UNKNOWN|NOT_FOUND
// Vuforia is starting, but tracking has not been lost or found yet
// Call OnTrackingLost() to hide the augmentations
OnTrackingLost();
Thank you.
Vuforia Engine Support