“Best way to stop and “reset” an Animation?”
Say you’re playing an animation, so
blah.animation.Play("spinTheLogo");
You want to stop the animation playing, and, you want it to simply return to the “original” “first” static state.
You want everything to be really clean so it is ready to use again with no problems, no other animations are disturbed, etc etc etc.
I’ve never really know the best way to do this.
I’ve seen and use code like either this…
blah.animation["spinTheLogo"].time = 0.0;
blah.animation.Sample();
blah.animation.Stop("spinTheLogo");
or this …
blah.animation["spinTheLogo"].time = 0.0;
blah.animation.Sample();
blah.animation["spinTheLogo"].enabled = false;
But I really don’t understand any subtleties between the two.
And there seems to be other ways to do it as well … along the lines of using animationtate-something-zero … and I don’t understand those either.
In a word what is the usual, best, and correct idiom when you want to “have an animation simply stop immediately, and immediately return to the unperturbed state?, ideally causing no other trouble, leaving the animation easily usable in the future, and for example not disturbing any other animations running on the same object or subobjects?”
Thanks!