Godot 4.3
For some reason this particular animation won’t play. I have no idea why this doesn’t work, could someone help?
if Input.is_action_just_pressed("attack2"):
$Animations.play("Knife")
Godot 4.3
For some reason this particular animation won’t play. I have no idea why this doesn’t work, could someone help?
if Input.is_action_just_pressed("attack2"):
$Animations.play("Knife")
A few things to check:
Input.is_action_just_pressed("attack2")
okay? Maybe the animation instruction works fine, but is just not called.$Animations
node correctly get? I guess so since you’re saying that particular animation doesn’t work, meaning you’re using $Animations
elsewhere, but I cannot tell without more code.Knife
the exact animation name?Let me know if that helps! If not, feel free to share more code/context
Sorry the code was vauge.
I could try doing the $Animations code again, but not the “Knife” part, I checked to see if that was the right name like 5 times. If I try and press the button while testing it only plays one frame of the animation before going back to idle.
If it plays for a frame and goes back to another animation, either your knife animation lasts for one frame (which would be weird so I guess it’s not that), or another animations plays right after, overriding the knife animation.
Are you playing your idle animation in process?
well I did consider that this line of code is in another script, meaning the idle is still playing while the knife animation tries to play.
but now it only restarts the current animation, never playing knife animation though