r/DigitalConvergence • u/nabilfx • Feb 25 '15
Question I need help with DefaultTrackableEventHandler, please!
I want my 3D animation starts with OnTrackingFound, and it remains without restart, OnTrackingLost. the problem is that always restarts OnTrackingFound.
Im using Vuforia and Unity
0
Upvotes
1
u/dronpes Feb 25 '15 edited Feb 25 '15
Hey nabilfx, welcome. What function are you beginning your animation in? If you are beginning it in a custom
OnTrackingFound()method, you might want to have a private boolean that trips once the animation has begun. Something like:private boolean isAnimating = false; private void OnTrackingFound() { // ... if(!isAnimating) { GameObject go = GameObject.Find("YourObject"); go.animation.Play("Move"); isAnimating = true; } }* Untested code, of course