2D Toolkit Forum

2D Toolkit => Support => Topic started by: Kea on July 23, 2012, 06:59:14 pm

Title: Different animation speed for objects with same animation
Post by: Kea 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?
Title: Re: Different animation speed for objects with same animation
Post by: unikronsoftware 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.