Godot Version
3.6
Question
I need some insight on how to handle connecting signals between child components of scenes loaded in as nodes. I’ve been working on a tactics game that uses custom state machine nodes to determine what the different parts of the game should do (character behavior, UI, etc.). Due to the nature of the game, I found that it made the most sense to have the state of one node be influenced by the state of another node. For example, when a player character starts their turn, the UI would then need to update to display the character details.
What I am having trouble with is what approach to take with connecting the signals of these state machines. I’ve seen other posts that recommend using a signal bus as an autoload that stores the signals that connect the nodes. This is the approach I first used. While this is easy to implement, it doesn’t sit right with me that I am essentially making global access signals that are only used in one scene. With this in mind, I modified the project so that the signals are now connected to each other directly. While the signals are no longer “global”, the current implementation is not the cleanest.
What thoughts do you have on these different approaches?