animation_finished signal not triggered?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By vnmk8

I have a Skeleton2D node for my player, the animations are handled by the AnimationPlayer node with a AnimationNodeStateMachinePlayback resource type in a AnimationTree Node, to change animations I use eg: my_animation_state_machine.travel("run"). now the AnimationPlayer node has a built-in signal called animation_finished(anim_name) that should trigger when any of the animations are finished playing but when I connect this signal nothing happens what am I doing wrong? is that the way the signal is supposed to be used?

:bust_in_silhouette: Reply From: theMX89

hi.
maybe i could see your code? the way you describe your problem, everything seems to be right.

it should look something like this:

func _on_AnimationPlayer_animation_finished("walk"):
get_tree().change_scene("main.tscn")

pass # Replace with function body.

(thats just an example)

it works when i use eg: AnimationPlayer.play("run") the animation_finished(anim_name) signal triggers but not when i use my_animation_state_machine.travel("run") to switch between animations.

vnmk8 | 2021-07-31 19:40