How can I make the animation match the speed of acceleration?

Dell7730Dell7730 Member, PRO Posts: 388
edited March 2015 in Community Tutorials

so basically what i'm asking for is when the speed of movement to a direction is slow, i would like the animation to match at slow speed, when the movement accelerates, the animation speed up as well

Best Answer

  • SocksSocks London, UK.Posts: 12,822
    edited March 2015 Accepted Answer

    @tatiang said:
    You can check the speed of an actor through it's X and Y linear velocity attributes.

    Yep, you can find an actor's velocity with . . . the square root of the square of X linear velocity + the square of Y linear velocity . . . which should look something like this:

    sqrt(pow(self Linear Velocity X, 2)+pow( self Linear Velocity Y ,2))

    This will give you the actual velocity of an actor regardless of what direction it is moving in.

    Example - an actor moving right at 100pps (linear velocity X 100) and up at 100pps (linear velocity Y 100) is moving at a velocity of 141.42pps at 45°.

    EDIT, whoops, this should really be aimed @dellagarpo

Answers

Sign In or Register to comment.