How do I put 3d animation continues?

The animation of walking is in loop, how do I put it in continuous? I don’t know, animation is literally on loop, walks and goes back to the same place it was

Please give more details on your topic, explain as much.

func _physics_process(delta):
var animation_player = $“Knight D Pelegrini/AnimationPlayer”

velocity = Vector3.ZERO # The player's movement vector.
if Input.is_action_pressed("cima",true):

	
	velocity.z += speed_cima_baixo
elif Input.is_action_pressed("baixo",true):
	
	velocity.z -= speed_cima_baixo
elif Input.is_action_pressed("direita",true):
	
	velocity.x -= speed
elif Input.is_action_pressed("esquerda",true):
	
	velocity.x += speed
else:
	if velocity.x == 0 and velocity.y == 0:
		animation_player.play("idle")
if velocity.length() > 0:
	velocity.normalized() * delta
	move_and_slide()
	animation_player.play("andar")

, I want when I walk it plays animation “walk” but the animation plays in loop, character walks but the animation does not follow the character, animation starts and restarts and so on in loop, I wanted to send a video to explain better but I can’t …

I’m not entirely sure I understand what the problem is that you’re facing, but my guess is that is_action_pressed is to blame. That method returns true as long as you hold a button. Try replacing it with is_action_just_pressed, which only fires once (when the button is pressed for the first time.) You have to set the animations in each if statement.

Also, consider moving the content of the method to _process instead.

nop, I did what you said and made the character not move, but thank you

use an AnimationTree and create a state machine.

you can use the advance Expression to evaluate velocity directly, or use a variable.
here’s a tutorial:
https://godotforums.org/d/39521-this-is-how-to-use-animationtree-state-machine-transitions-with-expressions