-
-
Notifications
You must be signed in to change notification settings - Fork 20.3k
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
Add an "added_child" signal to Node #11260
Comments
Not sure on the performance end, but I can see tons of uses for the signal already :) |
While I see usages too, I never really needed such a thing. I mainly don't like the fact that not using it still makes you pay the cost of sending this signal for every node (also think about scene loading, which also adds nodes) |
I don't see the usage of that. Inserting a scene will result in the emission of many signals too like was mentioned before. |
Indeed, I think this would go against the signals philosophy of Godot. Built-in signals are meant to notify about stuff which was not triggered directly by the developer; child nodes are only added when the developer requests it, by instancing and adding a scene/node, reparenting stuff, etc. Apart from some internal things like tooltip timers which shouldn't be used for game logic anyway, the engine would not add children without you requesting it. As soon as an action is triggered by the developer, you can emit your own signal if that's relevant for your game logic (including from the animation player, which can also emit signals). |
You can use |
I think it would be good idea to have an
added_child(child)
signal toNode
I also don't think it would be very hard to implement, but in term of performances ? You guys are the knowledge owners on that point :)
Also, if this gets added, could it be merged for 2.1.5 ? 🙏
The text was updated successfully, but these errors were encountered: