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

instantiate packed scene with editable children and editor connected signal cause error "signal already connected" #85372

Open
rt9391 opened this issue Nov 26, 2023 · 4 comments · May be fixed by #85606

Comments

@rt9391
Copy link

rt9391 commented Nov 26, 2023

Godot version

4.2.rc2

System information

win11

Issue description

instantiate packed scene with editable children and editor connected signal cause error "signal already connected"

image
image

image
image
image

Steps to reproduce

  1. make a scene with a signal connection via editor(from child to parent).
  2. make another scene, add the previous scene as a child, and turn on "editable children".
  3. make yet another scene, then add the new scene in step 2 as a child
  4. in the third scene, use PackedScene.pack() to pack the child
  5. instantiate the packed scene
  6. observe the error "Signal '****' is already connected to given callable"

Minimal reproduction project

BugSignalBug.zip

@akien-mga
Copy link
Member

I can reproduce the error in 4.2-rc2 and 4.1.3-stable.

@Rindbee
Copy link
Contributor

Rindbee commented Dec 1, 2023

Seems related to #42161.

A duplicate of #48064.

Currently, editable children cannot edit connections in sub-scenes.

if (p_node != p_owner && p_node->get_owner() && p_node->get_owner() != p_owner && !p_owner->is_editable_instance(p_node->get_owner())) {
return OK;
}

So the connections in the sub-scene should not be parsed here.

@Rindbee
Copy link
Contributor

Rindbee commented Dec 2, 2023

This may be mainly due to the fact that get_scene_instance_state()/get_scene_inherited_state() will return invalid SceneState if not called in the editor.

@cixil
Copy link
Contributor

cixil commented Nov 30, 2024

This may have been fixed by #97303

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