I’m using Godot 4.x and I’m facing an issue where my animation is not playing when I try to trigger it.
I have set up an AnimationPlayer and created the animations correctly, but when I run the scene and press the input key, nothing happens.
What I expected:
The animation should start playing when I press the assigned key.
What actually happens:
Nothing plays, and there is no error in the output.
My setup:
- Godot version: 4.x
- Using AnimationPlayer node
- Animation name is correct
- Input action is already defined in Input Map
if Input.is_action_just_pressed(“attack”):
$AnimationPlayer.play(“attack”)
What I already tried:
- Checked animation name spelling
- Verified AnimationPlayer node path
- Recreated animation
- Checked Input Map settings
But still the animation does not play.
Can anyone help me figure out what I’m missing?