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

When using placeholders, signals and groups are added to the InstancePlaceholder and lost when instancing #18697

Open
eon-s opened this issue May 8, 2018 · 3 comments

Comments

@eon-s
Copy link
Contributor

eon-s commented May 8, 2018

Godot version:
3.x and v4.0

Tested on 3.4b3 and 4.0.dev.20210811.official [7188cb6]

OS/device including version:

Issue description:
Scenes set as placeholders in the scene tree, get the connections and groups set via the editor when the placeholder is added.
This means that there will be errors when the engine tries to connect non available signals and groups added to the placeholder too, both will be not available to the instances made from that placeholder.

I think this should be partially handled by the packed scene instance(), it needs to detect placeholders (I think it already do that) and InstancePlaceholder needs to have a way to store connections and groups to later assign to the instanced Nodes and not to the placeholder.

Steps to reproduce:

  • Set a scene as placeholder and connect it with some signal just available on that type of node.
  • Add that scene to a group too.

Run the game and see the connection error, instance that placeholder and see that connections and groups are not on the instanced node.

Project for Godot 3
InstancePlaceholderSignalsG3.zip

Project for Godot 4
InstancePlaceholderSignalsG4.zip

@eon-s
Copy link
Contributor Author

eon-s commented Sep 8, 2018

After using this a bit, I think that may be better to just add a warning icon if a connected and grouped (in the current scene) node is turned into InstancePlaceholder.
The warning can explain that new connections and groups added to the instanced scene will be lost.

This is because the user may want to connect the InstancePlaceholder or even add a script to it at runtime to give it a special behavior.

@qarlosh
Copy link

qarlosh commented Feb 11, 2020

I think that signals assigned in the editor should be connected when instancing at runtime. That is the expected behavior, placeholder exists to instantiate the scene that you have configured in the editor. And the same for groups.

@eon-s
Copy link
Contributor Author

eon-s commented Aug 16, 2021

Tested this on godot 4 and the issue remains, the OP was updated with reproduction projects for Godot 3 and 4.

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

3 participants