#Getting all packed into a scene

2 messages · Page 1 of 1 (latest)

normal sky
#

You have to set their owner first, as per the docs:

When saving, the node as well as all the nodes it owns get saved (see Node.owner property).

You can fix this by making a simple recursive method in a new node helper class:```swift
class_name NodeUtil extends Object

static func set_children_as_owned(node: Node, owner_node: Node = node) -> void:
for child in node.get_children():
child.owner = owner_node
NodeUtil.set_children_as_owned(child, owner_node)
You can then call it right before you pack the scene withswift
NodeUtil.set_children_as_owned(get_tree().current_scene)

etc