Godot Version
4.3
Question
I have a “signal bus” autoload called Signals to which I add signals programmatically, thus:
Signals.add_user_signal("Example_signal")
Later on, in a different node, I can verify that Signals has the signal added:
var has_signal := Signals.has_user_signal("Example_signal")
I have a C# API method called “AddSignal” that expects a gdscript signal reference, but I can’t seem to find a way to get a signal reference from my Signals autoload. I’m looking for an object method like:
csh_obj.AddSignal(Signals.Example_signal) # produces error
The error is: Invalid access to property or key 'Example_signal on a base object of type ‘Node (signals.gd)’.
Likewise, it seems like the get
or get_indexed
methods might work (they don’t produce errors) but they don’t return a usable signal reference, either. The method I really want is:
Signals.get_user_signal("Example_signal")
But, this doesn’t exist.
Is there a way of doing what I want?
Edit: Just to be clear, this is not a show-stopper sort of problem. I have other ways to get where I’m going… I just thought there should be a way to do this!