Detecting if a CharacterBody2D is touching a tile with a specific data layer

Godot Version

4.5

Question

Hello! I am new to godot and want to learn more. I was wondering, how do I detect if a CharacterBody2D is touching a tile with a specific data layer.

Add an area to your character body setup and use its body_shape_entered signal. It will fire whenever a cell’s collider enters the area.

1 Like