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

Duplicated nodes in tree after loading packed scene with editable children at runtime #49660

Closed
pouleyKetchoupp opened this issue Jun 16, 2021 · 0 comments · Fixed by #49664
Closed

Comments

@pouleyKetchoupp
Copy link
Contributor

Godot version

3.3.2.stable, 4.0.dev (0818a46)

System information

Windows 10

Issue description

We're using packed scenes in a game as a way to save the current state for different parts of the game world.

But it looks like "Editable children" is not properly handled at runtime when loading packed scenes (while it works properly in the editor).

Whenever a scene contains an instance of another scene with "Editable children" enabled, all the child nodes are duplicated in the tree after saving and loading the scene again. One version of them matches the original scene and one version matches the edited instantiated nodes.

Steps to reproduce

Using the minimal repro project:

  1. Run the game. Scene 1 is loaded by default.
  2. Press 2 to save scene 1 and load scene 2.

  1. Press 1 to save scene 2 and load scene 1 again.
  2. Press 2 to save scene 1 and load scene 2 again. Observe new primitives have appeared in the scene.

  1. Open the remote tree tab in the editor and observe duplicated nodes under /root/Scene2/Scene1

In order to reset the saves and start the repro again, you can press R to delete all the saved scenes, otherwise the scene keeps being saved with more and more duplicated nodes.

Minimal reproduction project

3.x project:
editable-duplicated-nodes.zip

4.0 project:
editable-duplicated-nodes-4.0.zip

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

Successfully merging a pull request may close this issue.

3 participants