How do you rewind an animation that isn't playing?

I’m using an animation to hide an object, so when I reset the scene, I want the animation to be at the start of the ‘Show’ animation. I can’t seem to make this happen unless the animation is already playing at the time.

I’ve tried animation.Stop(), animation.Rewind(), and animation[“ClipName”].time = 0, but they don’t seem to do anything unless the animation is already playing. I’ve resorted to creating “Reset” animations which just have two keyframes of the hidden position - but this is less than desirable. Surely there is a more direct way?

animation[“ClipName”].speed = -1;

will make an animation play backwards

animation.Play("ClipName");
animation["ClipName"].speed = -1;
animation["ClipName"].time = 0;

will make the animation snap to the first frame

animation.Play("ClipName");
animation["ClipName"].speed = 1;
animation["ClipName"].time = animation[ClipName].length;

will make the animation snap to the last frame

hope it helps …

Sounds like you’re looking for Animation.Sample.