Godot Version
4.1.1
Question
I’ve been having trouble trying to make this jump animation work where the velocity of the player changes what the frame of the animation plays. I barely know enough about code to solve this, but what i am trying to have is have frames 0 through 5 play depend on the velocity of the player with 0 being the highest (like the first frame of jumping) and 5 being the lowest (falling really far down)
if is_on_floor():
if direction == 0:
animated_sprite.play(“idle”)
else:
animated_sprite.play(“run”)
else:
if velocity.y <= 100:
animated_sprite.play(“jump0”)
if velocity.y <= 40:
animated_sprite.play(“jump1”)
if velocity.y <= 0:
animated_sprite.play(“jump2”)
if velocity.y >= 0:
animated_sprite.play(“jump3”)
if velocity.y >= 40:
animated_sprite.play(“jump4”)
if velocity.y >= 100:
animated_sprite.play(“jump5”)
I started this using the recent brackeys tutorial, but after finding nothing on changing individual frames I started to make 6 different animations with each frame in it, but then that didn’t work and after trying any other method it would play only the frames 2 and 3. I am sorry for having barely any knowledge on stuff like this.
currently the bottom seems to work pretty well, but jump0 and jump1 do not play at all