0 votes

In GDscript you can do something like:

# some_node
signal my_signal

func signal_emitter():
    if something == true:
        emit_signal("my_signal")

#other_node

func signal_responder():
    get_node("some_node").connect("my_signal", self, "some_func")

func some_func():
    do_stuff()

How do you do this in C#? I'm guessing it has something to do with AddUserSignal and EmitSignal and someNode.Connect but trying this throws an error 'Attempt to connect nonexistent signal.. to method..' so I'm guessing AddUserSignal is the wrong way to go about this..?

asked Nov 2, 2017 in Engine by hnuqweasd (34 points)

You should check Git discussions. Right now it's not implemented and there is an open issue:

Signals issue

Thanks :) I can work around it for now

Should we prefer C# pattern (events) over Godot pattern (signals) ?

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.