Hi, I think the issue is that the “idle” animation is overriding the “jump” animation. Before playing the idle animation, you should check to see if the player is not jumping at the moment.
Thank you for the response. How will i go about doing that?
I am new to Godot and making games. So my knowledge isn’t that great.
Good day. Between your animations dissonance.
When your heroe jumping changes vector.y but vector.x = 0 and this is identically animation “Idle”.
Based on your condition: if is_on_floor():
$AnimatedSprite.play(“Jump”)
But when you jumping you don’t stayon floor. Invalid animation condition.
I would code it like this:
var const UP = Vector2(0, -1)
var const GRAVITY = 100
var const MAXSPEED = 100
var const MAXGRAVITY = 200
var const JUMPSPEED = 800
var movement = Vector2(ZERO)
func _physics_process(delta):
movement = move_and_slide(movement, UP)
movement.y += GRAVITY
if movement.y > MAXGRAVITY:
movement.y = MAXGRAVITY
move()
animation_update()