Embedded Area2D Collisions

Godot Version



I am banging my head against the wall over this issue.

Here is the structure of my Scene’s nodes that I am dealing with
---- CollisionShape2D
---- CollisionShape2D

The masks and layers are all set to 1 for all of my collidable Nodes, for simplicity.

The Area2D is positioned inside of the other Area2D in the editor, it is a specific collision zone used for a more specific purpose.

Whenever I go over other collidable Area2D with this entire node structure the _on_body_entered of the second Area2D will trigger only OCCASIONALLY

Whenever I go over a my colliable player, a CharacterBody2D it will trigger ALL THE TIME.

What in the world is going on here? I am also dragging the object using mouse input which maybe has something to do with it.

It draws the first area2d over the second one, leading to it being inconsistent.

So this isn’t quite so obvious in my opinion, but as a developer, it is embarrassing to admit I didn’t fully read the documentation

On Body Entered
“Emitted when the received body enters this area. body can be a PhysicsBody2D or a TileMap. TileMaps are detected if their TileSet has collision shapes configured. Requires monitoring to be set to true.” Godot Docs

On Area Entered:
“area_entered(area: Area2D)Emitted when the received area enters this area. Requires monitoring to be set to true.”

I was trying to use body which only detects PhysicsBodys entering/exit in general which is probably best used for StaticPhysicsBody or anything inheriting from PhysicBody2D.

Area2D doesn’t, yet still sometimes detects collisions, it is probably just a quirk. So Body Entered is very bad for detecting Physics collisions for Area2D they just aren’t supposed to interact that way, use the Area Entered signal.

This is an important distinction that I think a lot of newbies to Godot wouldn’t immediately get. So I’ll post this!