Offsetting animations

If I have an animation that exists, for example, from frame 1 - 40. Is there a way to start the animation on frame 25 have it run until 40 and then loop from 1 - 40 continuously?

I don’t think there is any way to do this with a setting but you can do it by resetting the playback from a script or by splitting the leading part and the looping part into two separate animations.

Hello, I have a similar question.
How can I set an animation to a particular frame?
Is it possible?
I am looking for some method like animation.Rewind(), which takes a parameter with the frame number.
Any workaround accepted :slight_smile:

Thanks for the attention, Pasko

This will set an animation to a particular point in the animation. It sets it to a specific time in seconds into the animation though, rather than frames, since Unity is framerate independant. So you’ll just have to figure out what time a certain frame corresponds to.

That’s perfect, thank you!

Ok, no, unfortunately the problem was not solved.

The situation is: I have 3 animated things. All of them are instances of the same object, imported from max with an animation, named “Take 001” (default name).
I’m not able to target a single animation, so the 3 objects move in perfect syncro.
How should I de-sync them? I thought to give each a random starting frame, but working on animation[…] seems to modify all of them.

The code currently is:

animation.AddClip(animation.clip, this.name);
animation.Play();
animation[this.name].time = l_nDelay; // random

What am I doing wrong?

Thanks for the attention, Pasko

One suggestion is to use animation.PlayQueued to start the animation. This function returns a new animation state which you should be able to modify without affecting any existing states.