Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

child_exited_tree signal fires before child has exited the tree #59210

Closed
markdibarry opened this issue Mar 16, 2022 · 6 comments · Fixed by #62241
Closed

child_exited_tree signal fires before child has exited the tree #59210

markdibarry opened this issue Mar 16, 2022 · 6 comments · Fixed by #62241
Milestone

Comments

@markdibarry
Copy link
Contributor

Godot version

4.0 dev (d9f8cad)

System information

Windows 10

Issue description

The new child_exited_tree signal should fire once a child has exited the tree, but it fires too early.

Steps to reproduce

  1. Add a child node.
  2. Connect the child_exited_tree signal
  3. remove the child

Minimal reproduction project

childExit.zip

@Calinou Calinou added this to the 4.0 milestone Mar 16, 2022
@Calinou
Copy link
Member

Calinou commented Mar 16, 2022

For reference, this signal was added in #57541. cc @reduz

@Mickeon
Copy link
Contributor

Mickeon commented Mar 19, 2022

I wonder now, if it would be more useful to keep it as the child_exiting_tree signal...

@markdibarry
Copy link
Contributor Author

Should we split this into two tickets? Rename child_exited_tree as child_exiting_tree and create a child_exited_tree signal?

akien-mga added a commit to akien-mga/godot that referenced this issue Jun 20, 2022
The name was confusing as this signal is emitted around the same time as
`tree_exiting` and `NOTIFICATION_EXIT_TREE`, i.e. while the child node is
still in tree.

Fixes godotengine#59210.
akien-mga added a commit that referenced this issue Jun 20, 2022
The name was confusing as this signal is emitted around the same time as
`tree_exiting` and `NOTIFICATION_EXIT_TREE`, i.e. while the child node is
still in tree.

Fixes #59210.

(cherry picked from commit 3e6de68)
Riordan-DC pushed a commit to Riordan-DC/godot that referenced this issue Jan 24, 2023
The name was confusing as this signal is emitted around the same time as
`tree_exiting` and `NOTIFICATION_EXIT_TREE`, i.e. while the child node is
still in tree.

Fixes godotengine#59210.

(cherry picked from commit 3e6de68)
@wez470
Copy link

wez470 commented Dec 11, 2023

Can this be re-opened?

child_exited_tree was never created. I do see in the rename PR the author thought it was not needed, but I have a use case for it.

I want to use this for navigation. When a destructible environment object is destroyed, I want to re-bake the nav region, but the only hook I have is "exiting". So if I call bake in here, the nav mesh will still include the destroyed object. Yes, this can be worked around, but it's not ideal.

I find the slightly off parallels between enter and exit confusing. I initially saw "child_entered" and assumed the other would be "child_exited". Only after it wasn't working did I look closer and realize it was "exiting". "child_entering" and "child_exiting" or "child_entered" and "child_exited" make more sense as pairings (IMO), but we have a mix between the two currently.

@AThousandShips
Copy link
Member

Please open a proposal for this as it's a new feature and this has been closed for a long while

@wez470
Copy link

wez470 commented Feb 6, 2024

I actually just started a discussion here: godotengine/godot-proposals#9036

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants