Using area2d from @export with on_body_entered event

Godot Version

4.2

Question

Hey! so i’m very beginner with this engine and i’m trying to experiment things as i go, i got stuck doing something while trying to learn, i wanted to define a collision that when the player enters it it’ll show up a popup with the area’s name.

But, i didn’t manage to make signals interact with the script, its an entire separate scene with a control node.

Sorry for my poor english but can anyone help me? i don’t wanna be spoonfed with code, if possible just tell me alternatives like, “oh you should use x function” or something, i want to really learn this engine.

Here’s my code:

My zone title node:

My map, the big circle is the testing collision:

1 Like

I think you should connect the on body entered signal, either via editor or code, to a function, then check if the body is the player. This also simplifies the if condition down.

Thanks! i totally forgot i can just use .connect! you saved me :slight_smile:

1 Like