I have declared a signal in c# using the following:
[Signal]
public delegate void abcEventHandler(Boolean connect);
The i am later on emitting the singal using
EmitSignal("abcEventHandler", true );
How can i react on this signal in GDScript?
i am trying to do
connect("abc", someUpdateFunction)
However i get the following error: In Object of type 'Node3D': Attempt to connect nonexistent signal 'abc' to callable 'Node3D(someScript.gd):: someUpdateFunction'
This creates a new instance of the object MyCSharpScript.cs
MycSharpScript.cs is NOT a node (previously was, changed it). it does not extend the node class since this is isnt needed for me.
In main.gd i do the following:
var object
var my_csharp_script = load("res://scripts/MycSharpScript.cs")
func _ready():
var MyNode = get_node("..")
object = my_csharp_script.new()
if MyNode != null and MyNode.has_signal("abc"): //tried abcEventHandler
MyNode.abc.connect(someUpdateFunction)
else:
print("No such signal")
object.begin("arg1")
A script needs to extend at least from Object to be able to use Godot’s signal system. You can try using Object.get_signal_list() to get a list of signals from that object and see how it’s called.