Cannot start new animations over my idle animation

Here is my code to try start the animation:

extends Node3D


# Declare the AnimationPlayer node
@onready var anim = $AnimationPlayer

func _ready():
	# Ensure the AnimationPlayer node is available
	if anim == null:
		print("AnimationPlayer node not found!")
		return

func _process(delta):
	# Check if the attack input action is pressed
	if Input.is_action_just_pressed("attack"):
		print("RECIEVED INPUT")
		# Play the fire animation
		anim.stop("idle")
		anim.play("fire")
		anim.play("idle")
		print("PLAYED ANIMATION")

In the animation tree, the idle animation is set on loop if that’s helpful.

help, please

Make sure to post in Help for help. When using an AnimationTree you cannot use the AnimationPlayer to play animations as they are being overriden by the AnimationTree. You probably want animationState.travel("fire")

2 Likes

I tried. Doesnt work. Thanks tho