Instantiated scenes can't become root

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By RedPilled

Why can’t instantiated scenes become root?

I am trying to build a vehicle, and each part like the body or wheel is a separate scene so I can instantiate as many of them as required to assemble different vehicles with various combinations.

I want the ‘body’ scene to be the root node of new vehicle scene that I am creating, but that isn’t possible.

:bust_in_silhouette: Reply From: Zylann

I’m not sure what the problem is here. It is definitely possible to make the body of the car as root of your scene. Any node you want can be the root.

When creating a new scene, you have choice between Node2D, Spatial or Control, but you can also choose anything else with the button below.

And when you already have a scene with nodes inside it, you can right-click on one of them in the scene tree dock, and in the context menu choose “Make Scene Root”.

When I right-click on an instantiated scene and click on “Make scene root”, I get this alert:
enter image description here

Also, I just noticed this when I hover over the instance node button:enter image description here

What is the difference between instanced scene and inherited scene?

RedPilled | 2020-03-01 04:38

Huh. I didn’t know that.
I thought there was actually no difference between an instanced scene and an inherited scene… because when I think about it, an inherited scene just takes its base nodes and properties from another scene, which is what an instance is (except with editable children turned on by default). Maybe the problem comes from the workflow this implies.

What is the difference between instanced scene and inherited scene?

And that’s what I just described. I thought there was no difference. This button also implies that.

In the meantime, instead of “making the instance root” later, you should start by creating your scene as an inherited scene in the first place?

Or ask about that feature in the proposals repo, explaining in detail what you expect would happen when doing this. It must describe all possible cases, because it’s possible that it wasnt allowed due to a problem implementing it. For example, it is possible to make an inherited scene if the scene tree is empty, but what happens if you do this while there are nodes in the tree already? What if their name conflict with nodes that your scene will now inherit? I guess that has to be solved.

Zylann | 2020-03-01 18:02

In the meantime, instead of “making the instance root” later, you should start by creating your scene as an inherited scene in the first place?

Yes, that works. But it doesn’t “feel right” because I am trying to make a scene which has nodes that are instances of other vehicles parts like body, wheel, turret etc, with body being the parent of all other nodes as each part is attached to it.

RedPilled | 2020-03-02 06:21

Perhaps you need to make instanced scene local first with Make Local.

Xrayez | 2020-03-02 20:57

Perhaps you need to make instanced scene local first with Make Local.

The problem with making the scene local is that it will duplicate all the scene structure in your current scene, then you lose the capability of changing the root scene and get the changes everywhere …

chiara_jm | 2020-04-02 18:54