Quick answer: Godot CharacterBody moving through a StaticBody despite both having collision shapes? Layer / Mask values don’t align — the character’s mask doesn’t include the static’s layer.

A wall placed in the level uses layer 2; the player’s mask only includes layer 1. The player walks through the wall without collision.

Layer vs Mask

Layer: which categories this body belongs to (bitmask). Mask: which categories this body collides against (bitmask). A’s mask AND B’s layer > 0 to collide.

Common Setup

Player on layer 1, mask = 2|4 (collides with terrain and enemies). Terrain on layer 2, mask = 1 (collides with player). Enemies on layer 4, mask = 1|2 (collides with player and terrain).

Both Directions Counted

For one-sided collision (e.g. player triggers a sensor but sensor doesn’t affect player), set only one direction’s mask. For physical block, both must mask-match.

Visualize in Editor

Project Settings → Layer Names → 2D / 3D Physics. Naming layers (“player”, “terrain”) makes the inspector much clearer.

Verifying

Movement blocked by intended bodies, passes through intentional ones. No phantom collisions.

“Layer says ‘I am’; mask says ‘I see’. Pairs must intersect.”

Name your layers in Project Settings — the ‘3’ vs ‘5’ numbers become ‘Player’ vs ‘Terrain’ and debugging gets dramatically easier.