Godot Version
Question
I just started using Godot and I have set up my animations for my main character, I have idle, jump, and run animations set up properly… I am trying to set up “Unsheathe” to pull out a weapon, I have the animations frames set up from 0-9, I have “Unsheathe” in the bindings for both mouse and keyboard and controller, when I press those bindings in test play, it looks like it starts or wants to start the animation but it does not. Some of my script is:
if Input.is_action_just_pressed(“jump”) and is_on_floor():
velocity.y = JUMP_VELOCITY
# Get the input direction -1, 0, 1
var direction = Input.get_axis("move left", "move right")
#flip the sprite
if direction > 0:
animated_sprite.flip_h = false
elif direction < 0:
animated_sprite.flip_h = true
# play animations
if is_on_floor():
if direction == 0:
animated_sprite.play("idle")
else:
animated_sprite.play("run")
else:
animated_sprite.play("jump")
if Input.is_action_just_pressed("Unsheathe") and is_on_floor():
animated_sprite.play("Unsheathe")