I cannot select one animation node to get signals from.

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

I am trying to make it so that after an animation plays a signal is sent to the sprite, using _on_Restart_animation_finished(): but the script plays every time an animation finishes from other animation nodes.
func _on_Restart_animation_finished():
get_tree().reload_current_scene()
Please help

:bust_in_silhouette: Reply From: Becbunzen

I am not sure I understand what you want to do, but perhaps this can help. If you want to control what sprites are played, and how to deal with different situations of playing or not playing, it might be useful to look at doing something every frame with func _process. Use variables for different animations, with _idle, _death etc suffixes, so you can switch between them. Do not loop animations, instead restart the one you want depending on current state, or send signals if needed. For example:

func _process(delta):
	if(not $AnimatedSprite.is_playing()):
		$AnimatedSprite.play(current_hero)