Reputation: 1047
When Vuforia loses the marker, the 3D model which was "attached" to the marker is sticking to the screen. How to make it disappear if the marker tracking is lost?
Upvotes: 0
Views: 1043
Reputation: 10701
Look for the script where you have:
public void OnTrackableStateChanged(
TrackableBehaviour.Status previousStatus,
TrackableBehaviour.Status newStatus)
{
if (newStatus == TrackableBehaviour.Status.DETECTED ||
newStatus == TrackableBehaviour.Status.TRACKED ||
newStatus == TrackableBehaviour.Status.EXTENDED_TRACKED)
{
OnTrackingFound();
}
else
{
OnTrackingLost();
}
}
Then, implement OnTrackingLost:
void OnTrackingLost()
{
model.SetActive(false);
}
Upvotes: 4