2D Toolkit Forum
2D Toolkit => Support => Topic started by: LBandy on June 29, 2012, 03:03:11 pm
-
Hi there!
Thank you very much for this great plugin. However, I would like to know if there is a possibility to get the frame id which is currently playing? We need to synchronize multiple animation together, and knowing the actual frame in the animation is essential for this. I hope there would be a simple workaround for this.
Thank you for your help!
-
yup, i'd be interested in this one too :)
-
frame = (int)(anim.ClipTimeSeconds * anim.CurrentClip.fps);
That should do it.
-
;D
nice, i'll test that.
-
frame = (int)(anim.ClipTimeSeconds * anim.CurrentClip.fps);
That should do it.
Thanks for the advice. Is there a way to be able to sync the animation in a more precise way? Because if I use this solution, at a given 24 fps framerate the delay is noticable.
-
If you want to sync animations, you'll be better off syncing clipTimes, as frameIds are rounded down integers.
Get the ClipTimeSeconds from the source sprite, and then when calling Play on the second clip, use Play(id, otherClipTimeSeconds);
-
Thanks for this. The time sync works perffectly.