You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue description:
Coming from a background of react web development, I would love a page on the lifecycle of nodes, especially with regards to best practices around _ready() and when nodes become visible to the eye (rendering) in the viewport.
Some questions I have:
From print statements and breakpoints, it seems like nodes become visible as they enter the tree (_enter_tree()). But if I pause with a breakpoint in Parent A's _ready() function, I don't see Child B rendered in the viewport, despite it having visible == true. Does this mean the rendering of children waits for the parent to be ready?
Are there any pros/cons with changing reusable Child B's variables in Parent A's _ready()? Say we want to change a variable called "color" of Child B from red to green because this instance should be green. Is there a frame where Child B is "color" red if we change "color" in Prante A's _ready()? Would it be better to listen to the NOTIFICATION_PARENTED notification (which should happen as the node enters the tree if the nodes are setup by the local hierarchy and not a script) and change the variable instead (maybe bypassing Child B being ready with the incorrect value)?
Your Godot version: 4.2.1
Issue description:
Coming from a background of react web development, I would love a page on the lifecycle of nodes, especially with regards to best practices around
_ready()
and when nodes become visible to the eye (rendering) in the viewport.Some questions I have:
_enter_tree()
). But if I pause with a breakpoint in Parent A's_ready()
function, I don't see Child B rendered in the viewport, despite it havingvisible == true
. Does this mean the rendering of children waits for the parent to be ready?_ready()
? Say we want to change a variable called "color" of Child B from red to green because this instance should be green. Is there a frame where Child B is "color" red if we change "color" in Prante A's_ready()
? Would it be better to listen to theNOTIFICATION_PARENTED
notification (which should happen as the node enters the tree if the nodes are setup by the local hierarchy and not a script) and change the variable instead (maybe bypassing Child B being ready with the incorrect value)?Potential pages where these changes could go:
The text was updated successfully, but these errors were encountered: