How to start the animation of a duplicate object on a different frame

Hi everyone!

Let’s see if I can explain myself clearly:

I have a gameObject with an animation of 10 frames attached to it.
I need to duplicate the object several times, and I would like to alter the animation on each of the duplicates so the animation starts one frame ahead.

so the original would start at frame 0, the first duplicate at frame 1, the second duplicate at frame 2, and so on.

Is there anyway to do this, without having to create several different animations, or, if possible without having to create a single script for each of the duplicates?

If not, how could I do it anyway? I’ve been having trouble finding a way to actually control the animations frame by frame.

Thank you in advance

Unity does not have a method to goto a specific frame per say. But you can move to a specific time interval of an animation using Gameobject.animation[“name”].time - Legacy Animation

So in short, you can actually goto a specific frame by finding the time of the animation at that particular frame.
e.g. If the animation speed is 24 fps: It means 24 frames are rendered in 1 sec.

The first frame will be at 1/24 * 1. The second will be at 1/24 * 2. and so on.

So this snippet will do the trick:

gameobjectname.animation.Play ("Take 001");
gameobjectname.animation.Stop ();
gameobjectname.animation["Take 001"].speed = 0; //to make the animation pause
gameobjectname.animation["Take 001"].enabled = true;
gameobjectname.animation["Take 001"].time = (1f/24f)*frameNumber;