set animation speed to object's current speed

0 favourites
  • 2 posts
From the Asset Store
3 pixel charaters with over 8 animations each + animations with a gun
  • I am making a boost style 2d sonic game, anyway with the Sprinting animation I have set for sonic the animation speed is a bit scewif. Is there a way I can set the animation speed of his sprinting animation to the current speed that sonic is running at (gradually get faster as sonic moves)?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Sure, but you'll need to figure out the ratio of movement speed to animation speed.

    Say, if normal movement speed is 50px/sec and normal animation speed is 10 frames/sec, then you can do this:

    Sprite Set Animation Speed to (MovementSpeed/5)

    When movement speed increases to 100px/sec, animation speed will also increase to 20 frames/sec.

    Or if you want a much bigger increase in animation speed, you can modify the formula to something like this:

    Sprite Set Animation Speed to (10+(MovementSpeed-50)/2)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)