Godot Version
4.3 stable
Question
I have been using composition for making “Interaction Components” as StayAtHomeDev does in his FPS tutorial series.
I know composition is praised for modularity and flexibility so I decided to go with it.
I made a Door Interaction Node to add to doors, and a Light switch Interaction Node, both of them are added as children of their scenes and have a bunch of exports (locked, broken, which lights to control, etc.)
My problem stems from the fact that when I instantiate these in a scene, I cannot access the exported values directly. Since the composition Nodes are children of the instanced class, I need to either enable editable children in all of them (which I find to be error-prone) or just add another script that communicates with the interaction node.
I assume that’s the solution, but then why go through the trouble of using composition at all? Using two scripts for a single thing seems overcomplicated.
I just want to know if there are alternatives I’m missing, or if really this is not the use case for composition, and it should be used for more complex scenes that already have parent controller scripts.