Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | JulioYagami |
What is the difference between parents and owners?
Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | JulioYagami |
What is the difference between parents and owners?
Reply From: | SIsilicon |
This is what I can get from the docs.
null
. Therefore it won’t be saved with the currently edited scene.I was just answering the same.
p7f | 2018-12-07 13:11
Reply From: | p7f |
Hi,
Parent is the direct node above in hierarchy in your tree structure. For example, in the next tree:
->Node2D
—>Area2D
—>KinematicBody2D
------>AnimatedSprite
Node2D is parent of Area2D and KinematicBody2D, and KB2D is parent of AnimatedSprite.
Owner instead can be any node that is parent or grandparent etc. It is useful for packed scenes, for exampling in saving nodes at runtime. When you want to save a node, all the nodes it owns get saved also, but no the children it does not own. Also, from docs:
To keep track of the scene hierarchy (especially when instancing scenes into other scenes), an “owner” can be set for the node with set_owner. This keeps track of who instanced what. This is mostly useful when writing editors and tools, though.
Parent wont do in this case.