Clamp the rise
Sphere sweeps cap the target height below a roof, so the run keeps moving forward without pushing the player through the ceiling.
A rising wallrun that keeps its shape around real level geometry.
A Prince of Persia: The Sands of Time-style wallrun with a tunable arc, safety checks for awkward surfaces, curved-wall support and controls designers can use without touching code.
Recreate the rising arc from Sands of Time, stop it throwing the player into ceilings or off wall tops, and make the whole feel adjustable in the Inspector.
I first built the mechanic in Unreal, then rebuilt and expanded it in Godot for Zero Protocol. I was chasing the wallrun from Prince of Persia: The Sands of Time. What made it memorable wasn't just moving sideways along a wall. The character rose and fell through a clear arc, turning the wall into a short extension of the jump.
A flat wallrun worked, but it looked like sliding. The arc made it feel like momentum. The player catches the wall in mid-air, rises, crests and drops into the exit. There's no separate wallrun button or special mode: jump toward a valid wall while moving along it and the system picks it up.
Once the arc felt right, it started breaking against real levels. Under a roof, the curve drove the player into the ceiling. Near the top of a wall, the upper-body samples lost the surface and ended the run at exactly the moment the player expected to flow onto the ledge. Segmented walls produced false detachments, while corners and curved surfaces could redirect or strand the player.
I didn't want to throw the arc away, because that was the whole feel. Instead, I kept the curve as the ideal path and checked the real wall around it every frame.
Sphere sweeps cap the target height below a roof, so the run keeps moving forward without pushing the player through the ceiling.
Look-ahead probes recover the top surface and a last-safe-height cache prevents noisy samples from kicking the player out of the run.
A 0.12-second grace window bridges shallow gaps and segmented facades, detaching only when the surface has genuinely ended.
The component can run only on tagged walls or on any wall that passes the checks. Zero Protocol uses tagged walls so the level designer decides where wallrunning is allowed. Switching between the two is one Inspector option, not a different script.
Curved-wall support can also be switched on or off. With it on, the system checks the wall direction fifteen times per second and follows the changing surface. Convex tanks, concave barriers and round industrial structures all become usable. The system also gently closes the gap to the wall, holding the player to the surface without a sudden yank on the first frame.
In Godot, one WallRunComponent handles detection, the arc, surface safety, wall-jump maths and the reason each run ends. Small state-machine states handle animation and the move into and out of wallrun for both unarmed and melee stances. Every airborne state quietly checks for a runnable wall, so the player can catch one naturally without pressing a special button.
The component sends start, end and wall-jump signals to audio, VFX, camera, scoring and progression. Those systems can react without being built into the movement code.
The system started as one very specific wallrun and grew into something designers can reshape. They can make a short, flat combat run, a long rising set piece, a sprint-gated skill check or a route that chains forever without touching the script.
The component doesn't have one generic way to let go. A wall jump keeps full control and can catch the next wall. Reaching the end kicks the player up and away. Reaching the top pushes onto the surface and hands over to the mantle system. A blocker ahead causes a clear rebound, a ceiling clamps the rise, and touching the floor moves straight back into grounded movement.
Because each ending has its own result, animation, sound and the next state always know what happened. More importantly, the player keeps their momentum even when the level changes the ideal path.
The wallrun now sits alongside dash and mantle as one of Zero Protocol's three main movement tools. The M1S1 critical path uses it when the player jumps from a vehicle roof, runs across a billboard and lands beyond a blockade. It also supports alternate routes, climbs, curved industrial set pieces, combat flanks and arenas where the floor becomes dangerous.
The important thing is that it works reliably. The move started as an attempt to recreate one specific arc. It became a flexible component that keeps that feel across real level geometry and lets designers decide where wallrunning works and what each run asks of the player.
I can take a feature from the first idea through building, testing and tuning it.