I have a UI, that I was trying to consolidate by moving part of it to it’s own Scene (“Save Branch as Scene”)
After adding a new Script to this new Scene, and moving some Code, all of the Signals from a different part of the Original Scene (connected through Editor) have disappeared!
The section I moved is not part of the sections that have lost their signals.
There was a Button in the moved Scene, that had a Signal on it, but it connected to different functions than the others.
Any idea what has happened, and how to avoid it happening again?
I believe it is because when they are in the same scene the paths between the nodes are known to the engine. If they are not part of the same scene, there is no other node there to connect the signal from reliably. You would have to do it in script instead, in ready. Or you could set it up manually every time you mix the two scenes.
The Signals that have disappeared were not connected to the (new) scene that was moved. They were connected through the Editor to a function in the Script on the root Node.
I am wanting to also move the “GatherableInfo” Node to it’s own Scene. If I have reconnected the Build Buttons (NOT to “GatherableInfo” in ANY way), are they likely to get lost again?
While editing the Script, and moving some Code into a Script attached to the new Scene, I pressed CTRL-S. This tried to save the Script, but it had errors in it.
Godot, realising that the Script was invalid, could not find a function for the Signals to connect to (even though they were there - but in an invalid script), and removed all of the Signals.
Reload from previous Commit, and ensured NOT to press CTRL-S until all red-highlights were resolved!