Animation won't play

Godot Version



In my godot game an animation on “hat_pos” called crouch will not play.

if rolling == true:"Dive")
		if recent_x > 0:"divingRight")
		if dir == 0:
			if is_on_floor() and Input.is_action_pressed("Down"):
				if crouching == false:"crouch")
					crouching = true
				crouching = false"idle")

	if crouching:
		print(hat_pos.assigned_animation)"Crouch") # RIGHT HERE is what  I am trying to play, but it plays "default" instead
	if rolling:
		velocity.x = roll_speed * recent_x

Any ideas why

case sensitive? should be “crouch”?

No, it’s the right name.

then it’s just if branching issues, the process function might also play default while it’s also play crouch, hence it’s not playing crouch
to fix this, either fix the branching logic or use AnimationTree animation

Could I get an example of how to do this?

if you meant the AnimationTree animation, search online:

AnimationTree godot

it should show you some vids how to use it

So my animation just moved something down, so because I couldn’t get it to work I just decided to change the offset of the hat.