I have a preloaded 2D scene with buttons in it, they are connected to the scene’s main script via the pressed() connection. When I run this scene on it’s own, the function works correctly, but when the scene is instantiated, the buttons no longer activate their connected signal.
I have already tried to use .connect() to reconnect the signal in the _ready() function for the scene’s script, but that didn’t work either for the instantiated scene. Does anybody know why this happens? Hopefully, its a simple Godot thing that I just need to click a checkbox for which I somehow haven’t heard about.
I’m guessing the input doesn’t reach the buttons, depending on what else is in the tree around where you instantiated your scene. Do the buttons visually react at all?
I worked it out, I was adding the instantiated scene as a child of the root node, so it was separate from the main scene. Once I changed it to be a child of the main scene, the connections worked correctly.