HumanRad145 / password_game

Inspirated by Password Game as a assignment for school
0 stars 0 forks source link

The little bug in the jump animation #12

Closed HumanRad145 closed 1 month ago

HumanRad145 commented 1 month ago

Jumping left don't allow me to stay left X-X

HumanRad145 commented 1 month ago

Edit: in jump() animator.Bool should be changed to animator.Play So it's loops once and does not change the animation

HumanRad145 commented 1 month ago

Edit: or get velocity of the previous frame

if isJumping

if prevVelocity < 0 and moveX = 0 then

    sprite.FlipX = true

else 

    sprite.FlipX = false

https://discussions.unity.com/t/how-to-get-the-position-and-velocity-of-a-object-in-2-seconds-ago/206519/2