Animation finished signal not triggered

Godot Version



<I am trying to change state when animation has finished. I have checked that animation is set to one shot instead of loop, and made sure that name is correct. However, the animation finished signal will trigger not in first time the animation has finished but in second time of animation finished somehow. I also tried to fixe this by disconnecting the signal once and connecting it again, but this time the signal was triggered in fourth time the animation has finished. do you have any idea why? btw the length of animation is 1 second.

func _on_animation_player_animation_finished(anim_name):
	if anim_name == "charge":
		state = States.RUSH

With the information you’ve provided, this is impossible to solve! If you can, upload a minimal project with the problem somewhere and link it here.

Also, what exactly do you mean when you say “signal will trigger not in first time”? Did you actually make sure the callback isn’t called at all or did you just not see the result you were hoping for (i.e. the state changing to States.RUSH)?

1 Like

thank you for an answer. I have already solve this problem. I was trying to change the state after await timeout in physics process, which caused this problem.