+7 votes

What is the difference between parents and owners?

in Engine by (690 points)

2 Answers

+7 votes
Best answer

This is what I can get from the docs.

  1. A node's parent is a node that is one level up the node's hierarchy.
  2. A node's owner is one that the node will be saved along with. Eg: If you make a node from script in the editor, it will have a default owner of null. Therefore it won't be saved with the currently edited scene.
by (3,916 points)
selected by

I was just answering the same.

+5 votes


Parent is the direct node above in hierarchy in your tree structure. For example, in the next tree:


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.

by (3,483 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.