Hello, when I try to connect a signal it A) doesn't automatically create the method like it's supposed to and B) doesn't seem to connect to the method I manually type.

I am trying to connect an Area2D "body entered" signal to another node. The code I wrote to test the signal is:

public void _on_GunRange_body_entered(){
    GD.Print("test");
}

The code runs but I receive the error:

E 0:00:04.801 emit_signal: Error calling method from signal 'body_entered': 'Node2D(Turret1.cs)::_on_GunRange_body_entered': Method not found..

What am I doing wrong here?

  • Could it be that you are missing a param in the method? When I connect signals on on_body_entered I usually do something like this (using Godot4 in this case):

    public override void _Ready()
    {
        BodyEntered += OnBodyEntered;
    }
    
    private void OnBodyEntered(Node body)
    {
        GD.Print($"Body {body.GetType().Name} entered");
    }

Could it be that you are missing a param in the method? When I connect signals on on_body_entered I usually do something like this (using Godot4 in this case):

public override void _Ready()
{
    BodyEntered += OnBodyEntered;
}

private void OnBodyEntered(Node body)
{
    GD.Print($"Body {body.GetType().Name} entered");
}
  • Sabb replied to this.
    9 days later