Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplication of nodes which reference children (within the editor) is either broken or very bad UX #82711

Closed
Go-Ba opened this issue Oct 3, 2023 · 3 comments

Comments

@Go-Ba
Copy link

Go-Ba commented Oct 3, 2023

Godot version

v4.1.1.stable.mono.official [bd6af8e]

System information

Godot v4.1.1.stable.mono - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1060 6GB (NVIDIA; 31.0.15.3623) - AMD Ryzen 5 2600X Six-Core Processor (12 Threads)

Issue description

Duplicating items within the inspector either with CTRL+D or the right click menu does not properly handle references to child nodes whether duplicating a regular tree of nodes or a packed scene.

Have a node with a child, the parent node has a script with an export that references the child node. Duplicate the parent node, and the duplicate will now be referencing the child of the original instead of its own child.
This seems like either unintended behavior or bad UX.

In order to get around this, I tried to pack the node into its own scene, but encountered the same issue. but even when duplicating the object after packing it into its own scene, it would still reference the children of the original.
There are the circular arrows next to the references, so I pressed those and then afterwards I was able to duplicate in the intended way. The problem now though is that when placing a scene from the file system into my active scene, those arrows are activated by default. This once again seems like it must be unintended behavior or otherwise terrible UX.

But even with those workarounds, there are still more problems. When you make a change in the packed scene, those circular arrows come back. The original and the duplicate will still function fine, but if you try and make ANOTHER duplicate of either of them without manually going through and resetting those circular arrows, the references will be messed up again.

So in order to have proper duplication behaviour I have to not only pack anything I want to duplicate into its own scene first, but also manually press the circular arrow on each and every node reference within the editor and then do that again EVERY time I make a change to the packed scene.

Unity handles this by simply copying any non-child references, and then changing child references to be the child of the new duplicate. This is the most intuitive approach and is the best for 99.9% of use cases. I cannot even think of a single situation in which you would want a duplicate to reference the children of the original.

this video pretty much shows the experience of trying to duplicate

Godot.duplicate.glitch.full.mp4

Steps to reproduce

Have a node with a child, the parent node has a script with an export that references the child node. Duplicate the parent node, and the duplicate will now be referencing the child of the original instead of its own child.

Pack the nodes into a scene and load that packed scene into another scene. Then without pressing on the circular arrows of the references, duplicate the packed scene. The duplicate will now be referencing the child of the original instead of its own child.

Press the circular arrows of the references before duplicating and then the duplication will work fine. But then make a change within the packed scene and save it, the circular arrows will be back.

Minimal reproduction project

As this is more of an interface interaction idk if a project is necessary, the video provided shows the core of the problem and the description notes some other situations not shown in the video.
Though I could spend the time to make a project if it's deemed necessary

@Jordyfel
Copy link
Contributor

Jordyfel commented Oct 3, 2023

#82670 #82686

@lostminds
Copy link

Pack the nodes into a scene and load that packed scene into another scene. Then without pressing on the circular arrows of the references, duplicate the packed scene. The duplicate will now be referencing the child of the original instead of its own child.

This seems like a bug at least, where instancing a scene with export references will add overrides (that's the little reset arrow-icon) for all the node exports to specific nodes in this scene instead of the default relative node paths from the instanced scene. Since you can reset them the expected behavior to me would be that they're set to the default relative node paths, just like other exports don't have overrides added when the packed scene is instanced.

@Calinou
Copy link
Member

Calinou commented Oct 3, 2023

Thanks for the report! Consolidating in #82670.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants