Getting Animation to Stop On Frame Zero

Hello. I need to get a spinning ball (using a Unity Animation) with a logo to stop spinning and stay at frame 0. According to the docs:

“Stopping an animation also Rewinds it to the Start.”
I tried anim.Stop(); and it DID stop, however it did not rewind to start. I’ve also tried these:

anim.Rewind();
anim.Stop();
anim.Stop();
anim.Rewind();

But neither one works. The ball does stop spinning but it stays on whatever frame it was last on. Is there another way to do this?
Thanks!
-Mo

Found it. You set the time to zero and call Sample(). Here’s the code in case anybody else needs it:

foreach (AnimationState state in anim)
{
state.time = 0f;
}
anim.Sample();
anim.Stop();

Can you explain in detail? I still do not understand the explanation …
I have done the same thing as you …
I tried to stop the animation objects with a button, I want to when it stops, the object is located at the starting position …
for example i have a cube with animated moving position. when the stop button is pressed, the cube back to its original position …
Can you help me,please?