Sending a signal to itself

Godot 4.3

I’m used to sending signals between different nodes using code, but how do I get an Area3D to send a signal to itself using code that a body has entered it? I’ve only done it with the editor.

You can emit signals as you would normally, connecting to your own signal is as follows, you could also use self if that makes more sense to you, all the example lines are equivalent.

body_entered.connect(_on_body_entered)
self.body_entered.connect(_on_body_entered)
self.body_entered.connect(self._on_body_entered)
2 Likes

Thanks!