Godot Version
4.3
Howdy
I’m working on a 2D sidescrolling MegaMan type game and i’d like to have two different jump animations. One for standing still and pressing “jump” (which i call “jump_up” and the other for pressing “jump” and a direction (“left” or “right”) (which i call “jump_up_side”).
I have the “jump_up_side” part figured out.
I have a “player_animation” function that is called in process, which looks like this:
if Input.is_action_pressed("jump") and Input.is_action_pressed("right"):
$Sprite2D.flip_h = false
$Sprite2D.play("jump_up_side")
if Input.is_action_pressed("jump") and Input.is_action_pressed("left"):
$Sprite2D.flip_h = true
$Sprite2D.play("jump_up_side")
and works like a charm.
the other part i do not get to work.
if i go like this:
if Input.is_action_pressed("jump"):
$Sprite2D.play("jump_up")
it overwrites the other part and only plays the “jump_up” animation all the time.
can someone help me out here?