How can I connect a signal from another node by code

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By CarlitosCUeba

I need an area to connect a signal to your father using the code. As much as I can do this manually

(C#)

:bust_in_silhouette: Reply From: Wakatta

If you mean parent by “father”

public class SignalExample : Area
{
    public override void _Ready()
    {
        Connect("body_entered", GetParent(), nameof(_coffin));
    }
}

And on the parent node

public void _coffin()
{
    //Do stuff
}