help with dealing with frames in mecanim states

hi there, i want to force the animation to goes to frame 1 and stop throw code but i cant find a solution. please help me.
i already tried this:
gameObject.GetComponent().ForceStateNormalizedTime(0.0f);
gameObject.GetComponent().enabled = false;

but doesnt work.

This is deprecated.

Take a look at this function

This function allow you to play any state from the controller.

This is not a good idea because it will reset your controller to the default state.

If you simply want the animation to stop you should use

Set your animator’s speed to 0 while you want your animation to play the same frame.

Best regards

work like a charm, thanks very much

1 Like