• Godot HelpGUI
  • Creating unique duplicates for viewports and their contents?

Is there some kind of default behaviour I can toggle to make it so that duplicates for a specific node and it's children are unique? It seems this is a bit of a problem in Godot specifically from what I've searched up online. So far I've gotten a setup with my viewports interfaces and I'm going to be making pretty heavy use of 3D text which will need to be changed individually.

In case you're wondering, make sub-resources unique doesn't seem to do anything and even when I set the viewport texture to a different one and have the text changed it doesn't seem to switch properly? Looks a bit odd but I thought I'd make a thread, included is also a screenshot that shows you the hierarchy setup that I'm going for. I'm pretty pleased with the look and setup of everything, it's just this strange issue of data duplicating itself that's posing a problem.

  • Solved on discord's server:

    The issue with the path was related to scene tree order. The ViewportTexture tried to get Viewport but the viewport wasn't added to the tree yet:

    So put the viewport node above the node that uses a ViewportTexture pointing to it. Don't forget to mark those textures as local_to_scene.

    The problem with the labels were that OP was trying to modify original scene expecting to make individual instances be modified as unique things. Scenes are like the base structure for those instanced nodes, so modifying the source modified those instances too. The solution was to go to were instanced nodes were, right-click them and select editable children. This way you can modify instances individually

I just thought I'd bump this because after doing some more investigating into the viewport behaviour. I'm actually inclined to report a bug because I don't think the viewport path should be behaving as it is but I wanted to check if I was just being daft. The resources local is enabled and I know properly now that makes each duplicate unique which is useful to know, but the viewport path doesn't set itself correctly onto the children of the new duplicate, the viewport path stays on the previous instance it was duplicated from.

Is this correct behaviour? I would like to confirm.

Okay, I just solved it in typical form just as I was about to ask some questions about the behaviour on the discord. What I needed to do was to click make sub-resources unique on the sprite 3D and then set the viewport path to the new viewport instance which meant I could change the text displayed properly. Now I just need to do the same in GDScript when the viewports get spawned in but that's for later.

Okay, scratch that, I've only got a slight work around for the problem, if I try to save the whole hierarchy as it's own scene I run into the same problem again because once you click and drag it's clearly not creating it's own unique instances as it should. This time though, I managed to generate some errors.

Cannot get path of node as it is not in a scene tree.
(Node not found: "VillageWorkshopViewport" (relative to "").)
ViewportTexture: Path to node is invalid.
Cannot get path of node as it is not in a scene tree.
(Node not found: "VillageWorkshopViewport" (relative to "").)
ViewportTexture: Path to node is invalid.
Viewport Texture must be set to use it.
Cannot get path of node as it is not in a scene tree.
(Node not found: "VillageWorkshopViewport" (relative to "").)
ViewportTexture: Path to node is invalid.

Solved on discord's server:

The issue with the path was related to scene tree order. The ViewportTexture tried to get Viewport but the viewport wasn't added to the tree yet:

So put the viewport node above the node that uses a ViewportTexture pointing to it. Don't forget to mark those textures as local_to_scene.

The problem with the labels were that OP was trying to modify original scene expecting to make individual instances be modified as unique things. Scenes are like the base structure for those instanced nodes, so modifying the source modified those instances too. The solution was to go to were instanced nodes were, right-click them and select editable children. This way you can modify instances individually