Hello Guest

Author Topic: Different animation speed for objects with same animation  (Read 3024 times)

Kea

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 40
    • View Profile
Different animation speed for objects with same animation
« on: July 23, 2012, 06:59:14 pm »
Hello.

My question:

There are a few sprites (balls), which move at different speeds (as in billiards for example). All use the same sprite animation. For each ball, I hope the animation speed (fps) in accordance with its speed, but when I change from one speed change at all. How can I assign a different rate for each animation?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Different animation speed for objects with same animation
« Reply #1 on: July 24, 2012, 11:23:48 am »
Hi,

This isn't supported out of the box, but should be easy enough to work around. In tk2dAnimatedSprite.cs, look for this line:
clipTime += Time.deltaTime * currentClip.fps;

You can scale the time here with a property to make an instance play faster/slower. I'll add something like this to the next official release.