Animation Speed Based on Velocity
I'm wondering if there is a way to base animation on an actor's velocity. So for instance, the actor accelerates from 100 to 1200 velocity and the frame rate changes from 4 to 12 frames per second in direct proportion with the velocity. The end result is that the actor is moving faster and actually looks like its moving faster (i.e. animation is playing faster). How might one achieve this?
Comments
Using one of these allows you to control how, why and where your animation plays.
If you have 12 frames to 1.100 velocity (1200-100), you need 1 frame for each +-100 of velocity.
One option is:
Using the change image you can set WHEN velocity = 200 change to frame 2
WHEN velocity = 300 change to frame 3
WHEN velocity = 400 change to frame 4
If your object moves from 100 to 1200 in 1 second, he will have all the 12 frames in one second
If your object moves from 100 to 1200 in 10 seconds, he still use the 12 frames but in 10 seconds.
I think it will give you the effect that you wanna.
Lol. As far as I remember this particular god stole that technique off other people (sorry . . . . other gods) here on this forum.
: )
If your actor moves across the screen you could base what image is to be displayed by (for example) the X position of that actor.
Imagine we have a 12 frame walk cycle . . . . as you progress across the screen we use the X position to chose the frame.
An attribute called FrameNumber could be added to by the X value and told to loop after 12 (%12).
This would be much more realistic and would also factor in velocity.
For each type of actor you will need a different approach.
Here you have two ways. I hope one fit for what you need.