+2 votes

I try to make a punch animation but every time i press the button i set for punch the animation runs for a moment and immediately goes back the the default "stand" animation. here is the code:

extends KinematicBody2D

var movement = Vector2()
onready var anim = get_node("AnimatedSprite")

func _ready():

func _process(delta):
    if Input.is_action_just_pressed("p1_punch"):

    elif Input.is_action_pressed("ui_right"):
        movement.x = 3

        movement.x = 0


in Engine by (14 points)

In the animation player, click on the button "Animation Looping", an icon that looks like "recycle". This will make the animation repeat endless.

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.