Quick answer: Godot 4 RigidBody2D with mass = 0 passing through other bodies? Zero-mass acts as a static body for collision resolution - use CharacterBody2D for player-controlled objects.
Player character set to mass 0 to avoid being pushed. Character now phases through enemies.
Use CharacterBody2D
For input-driven characters. Solid collision; no mass-based math; deterministic.
Or set high mass
If you want a heavy character that bumps but isn't bumped, mass = 10000. Effectively static under physics but still solid.
Pin/freeze for static
If the object should never move, use a StaticBody2D. The intent matches the body type; bugs disappear.
“Body types in Godot encode intent. Picking the wrong one is most physics bugs.”
Document the per-project rule: characters = CharacterBody2D; props = RigidBody2D; geometry = StaticBody2D. Three rules, no exceptions.