godotengine / godotengine/godot

When duplicating a node with property setters, changing either duplicate's or original's properties temporarily changes the other

Open
#98,576 4 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug confirmed topic:editor
Dominant language
C++
Stars
117k
Forks
26.8k
PR merge metrics
PR metrics pending

Description

Tested versions

v4.3.stable.official.77dcf97d8 and also 4.2

System information

Linux pop-os 6.9.3-76060903-generic

Issue description

Duplicating a scene with properties, then trying to change those properties, can visually affect the original and duplicate scenes. On reload of the parent scene, only the scene that you modified is actually modified, but this makes editing very annoying if you have to reload the parent scene every time you duplicate something. This occurs even if "Local to scene" is set to true for each of the relevant subnodes in the scene.

Maybe the @onready variables in the scene don't get duplicated somehow until the parent scene reloads.

Steps to reproduce
  1. Open "world.tscn" in the editor.
  2. Duplicate one of the BoxZ scenes, e.g., Box2.
  3. Modify the original Box2 size property (e.g., set size.y to 7 in the Inspector), and you'll see that it looks like it affects the duplicate as well.
  4. Reload the "world" scene (above viewport in bar, click X, then open "world.tscn" again)
  5. You'll see that the duplicate's size returns to what it was, and only the original's size was changed

you can also repeat and change the duplicate's properties instead of the original's in step 3, and the same thing happens. the original and all duplicates look like they are affected by property changes. however, when you reload the scene, only the scenes you changed were actually modified. you can also try duplicating an object multiple times, and duplicating the duplicates, and any change of any property in any of the "working set" will affect the others.

Minimal reproduction project (MRP)

test-duplicate.zip

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the supplied test-duplicate.zip reproduction, opening world.tscn and following the Box2 duplication steps in the issue. Inspect the editor's scene-duplication path and reproduce changes to the original and duplicate properties before reload. Done means changing either instance no longer visually affects the other, while the changed instance retains its edit after reloading.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.