tree_exited signal is called when queue_free() is called?

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

A slash.tscn that I’m using on my project is loaded on the initialization of a player. When the scene is first loaded the signals tree_entered and tree_exited are emitted (tree_exited happens because slash has queue_free() on animation finished). When I’m playing the scene and use a slash, my script adds it in the scene with add_child(). The problem is that it doesn’t fire the signal tree_entered and when the queue_free() is called, the signal tree_exited isn’t fired either. So, tree_entered signal is called when add_child() is called and tree_exited signal is called when queue_free() is called?

So, tree_entered signal is called when add_child() is called and tree_exited signal is called when queue__free() is called?

Correct. I cannot reproduce your problem. Can you upload an example project?

njamster | 2020-06-14 17:54

:bust_in_silhouette: Reply From: Felipe

Thanks for reply. Some good fellas helped me on discord. My problem was that the tree_exitedwas setted only for the node in the scene. As the slash was created and removed on every attack, the signal couldn’t be connected by editor (because it will only work once), the signal must be connected to every instance of slash: slash.connect("tree_exited", self, "_on_Slash_tree_exited")