Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | AlanCcE |
I want to play an a 4 frames animation, and i have tried with this code:
func _input(event):
var grounded = is_on_floor()
if grounded and Input.is_action_just_pressed(“attack1”):
$AnimationPlayer.play(“attack”)
and i already tried in this way:
func _input(event):
if Input.is_action_just_pressed(“attack1”):
$AnimationPlayer.play(“attack”)
but my character just stop the animation and dont play the current animation to attack.
What i can try? Its just the animation thats too small??
Have you checked if the attack animation works as you want before running the code? Maybe the animation itself is not running properly and is just stuck at Frame 1 (hence why it appears to “stop”).
Yuminous | 2021-07-10 08:39
The animation its working properly, but when i run this code, doesnt run even the first frame of the animation, i really dont understand whats happening
if grounded:
if move_dir == 0:
play_anim("idle")
else:
play_anim("walk")
else:
play_anim("jump")
#Bater no teto
if is_on_ceiling():
y_velo = 0
I have that above in my code, this can be the cause?
AlanCcE | 2021-07-10 08:48