Topic was automatically imported from the old Question2Answer platform.
Asked By
star-stalking
I ran into the problem being that the signal (connected through the editor or in the code) cannot find the method that was made on signal connection, even though it is already made.
The error it gives is:
emit_signal: Error calling method from signal ‘area_entered’:
‘Area2D(Player.cs)::_on_TestLight_area_entered’: Method not found…
Figured it out by going around looking at issues uploaded on GitHub.
You have to have a private void method inside the class.
…so, something like this:
public class Name : Type {
private void _on_signal_emitted(object area) //<-- (parameter used for
collision)
{
//Code here.
}
}
Also, it seems you’ll need to use the Godot internal editor to allow you to add a signal method when connecting for a signal in Godot instead of code. External editors do not allow Godot to add a signal function.