Hello Guest

Author Topic: Sync animations  (Read 3723 times)

FrameZet

  • Newbie
  • *
  • Posts: 2
    • View Profile
Sync animations
« on: December 26, 2012, 11:28:07 am »
Hi,

Thank you for this awesome tool. Creating sprites is easy with it!

However, I've little syncing problem. When my "First animation" is playing and then I start "Second animation" it should get timing from the first one. I've very little programming experience, so could you please write code example (Unity script) how to do that.

Thank you for your help! :)

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Sync animations
« Reply #1 on: December 26, 2012, 11:55:14 am »
If you have 2 animated sprites,

anim1
and
anim2

Lets say anim1 is already playing, and you want to sync anim2 to it, do this:
anim2.Play(anim1.CurrentClip, anim1.ClipTimeSeconds);

That'll play anim2 in sync with anim1.

FrameZet

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Sync animations
« Reply #2 on: December 26, 2012, 05:35:22 pm »
That works! Thanks!