Godot Version
4.5.stable
Question
hi everyone!
i’m working on a wall-cling / wall-walk movement system using a CharacterBody2D, and i’m running into stability problems that I haven’t been able to solve cleanly yet
the goal is for the character to stick to surfaces on demand and, while attached, the character should
- move along the surface with variable speed
- have gravity redirected to the surface normal
- work primarily with flat 90-degree walls, but ideally be robust enough to support any angle
the character can exit this mode at any time and return to classic downward gravity and standard horizontal movement, all handled using move_and_slide()
to detect surface normals, I’m currently using multiple raycasts
- from the center toward the character’s back “feet”
- downward to detect the ground
- forward to detect walls to climb
there is a defined priority order for normal selection (front wall normal → back floor normal → current floor normal). i’ve also tried snapping the character to surfaces before or during rotation
but the collision shape can penetrate walls during rotation, the character can enter infinite rotation loops at corners or edges, the overall system feels fragile, and in some cases the character can “fly off” surfaces
i’m currently trying to rethink the system from scratch, and I’d really appreciate any guidance or high-level advice on how to build a stable and robust surface-adhesion system for a CharacterBody2D. Even conceptual explanations or common patterns would already help a lot!
if I missed any important details, feel free to ask and I’ll clarify
thank you in advance!
