Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Skydome |
So I have created a cutout walking animation. And I have coded it to play when the character moves right. The problem is the character moves before the animation plays and the animation won’t play unless the movement stops.
This is the code. (Not the full code. I can paste full code if you want but I thought that was unnecessary)
func _process(delta):
velocity=Vector2()
if Input.is_action_pressed("ui_right"):
$Animations_Character.play("Walk")
velocity.x +=1
Animations_Character is the Animationplayer node
Found the solution I think. It’s working.
func _process(delta):
velocity=Vector2()
if Input.is_action_pressed("ui_right"):
if ($Animations_Character.current_animation!="Walk"):
$Animations_Character.play("Walk")
velocity.x +=1
Skydome | 2018-05-31 23:55