Difficulty with Layers/Masks

Godot Version: 4.4 Stable

Hello! I’m new to Godot and having a lot of trouble understanding how Layers and Masks work. In this project, i want to set up my character’s attack area, so i added the function func on_detection_area_body_entered(body: Node2D) -> void: to detect when an enemy enters its collision area. However, for some reason, it’s not detecting anything at all… The video shows exactly how the code and the Layers/Masks configuration are set up.

Link video: https://youtu.be/wiQN5CYDAzI

your area2ds dont have a collisionshape2d as children and therefore no hitbox to detect anything. You need to add a collisionshape2d as a child of the area the same way you do with characterbody2d

1 Like