Sychronization of animations

Hi guys,

I have a quick question with regards to animation playing.

If I were to execute the following codes:

gameobject1.animation.Play(“animation1”);
gameobject2.animation.Play(“animation2”);
gameobject3.animation.Play(“animation3”);

Will all 3 game objects play the animation at the same time?

Thanks in advance.

Hi, welcome to the forum!

Yes, if you make all three calls together like that then the animations will be synchronised.

Hi Andeee,

The timing of my animations seems to be a bit off. I suspect it could be due to the animations been executed in sequence thus the last animation get executed slightly slower than the first. (though they still do run concurrently)

That’s not how script execution works, those animations will all start playing on the same time. (if you put them in a different order you should see no difference)

If your animations are out of sync, I would check your animations first and make sure they really are in sync, then investigate if there is any reason why any of the objects wouldn’t be able to start playing their animation immediately. (although Play should trump everything except an animation on a higher level)

If they loop and aren’t the same frame size then do not expect them to match up…

Thanks for the explanation. :slight_smile: