this post was submitted on 16 Mar 2025
36 points (100.0% liked)

Godot

6466 readers
22 users here now

Welcome to the programming.dev Godot community!

This is a place where you can discuss about anything relating to the Godot game engine. Feel free to ask questions, post tutorials, show off your godot game, etc.

Make sure to follow the Godot CoC while chatting

We have a matrix room that can be used for chatting with other members of the community here

Links

Other Communities

Rules

We have a four strike system in this community where you get warned the first time you break a rule, then given a week ban, then given a year ban, then a permanent ban. Certain actions may bypass this and go straight to permanent ban if severe enough and done with malicious intent

Wormhole

!roguelikedev@programming.dev

Credits

founded 2 years ago
MODERATORS
 

so I have the RB2D collision layer just for collisions, and I have a area2d collision layer for detecting contact between cloned nodes, but it doesnt detect the two earth nodes touching unless I set the area2D collision mask to layer 1 and I'm not sure why.

top 4 comments
sorted by: hot top controversial new old
[–] popcar2@programming.dev 8 points 1 week ago (1 children)

Sounds like you misconfigured your layers and masks. The collision mask determines which layers it can touch, so it sounds like you have the earth Rigidbody on layer 1 and are trying to detect the body.

[–] BilliamBoberts@lemmy.world 5 points 1 week ago (1 children)

I want the RB2D on layer 1 so it collides with other bodies but I want some way to detect when it has collided with a clone of the area2d so I put area2D on layer 2. is there a better way to detect cloned nodes?

[–] popcar2@programming.dev 8 points 1 week ago (1 children)

You can create a Group for the planet then check in your code if that's what the area is touching. Ex: if body.is_in_group("planet"): #do something

[–] BilliamBoberts@lemmy.world 3 points 1 week ago

that worked. thanks so much!