The Ledge Strafe ability will play a strafing animation while the character is on a ledge. This ledge should be narrow to prevent the character from being able to walk normally across it. A wall must exist on one side of the ledge that the character can lean against.

Ledge Strafe validates two related features: a supporting ledge beneath the character and a nearby wall to lean against. The wall establishes the character’s orientation and offset, while the gap probe confirms that normal forward movement is unsafe. Both queries must remain stable along the route.

Setup

  1. Position Ledge Strafe near the top of the ability list so it can override lower-priority locomotion abilities.
  2. Set State to LedgeStrafe and add states with that same name to components whose values should change while Ledge Strafe is active. The demo uses LedgeStrafe states on Character IK and Capsule Collider Positioner.
  3. Include the ledge’s ground collider layer in Layer Mask. If Object ID is not -1, also add an Object Identifier with the matching ID to that collider’s GameObject. See Detect Ground Ability Base for the shared detection settings.
  4. A solid object should exist on one side of the ledge that the character can lean against.

Key settings

Detect Wall Distance

The distance to detect a wall before the ability can start.

Horizontal Start Offset

The distance to check to the left and right of the initial wall position to determine if location is a valid starting position.

Wall Offset

The distance that the character should stand away from the wall.

Gap Offset

The distance away from the wall that the gap exists.

Can Start Gap Offset Cast Radius

The radius of the cast when determining if a gap exists and the ability is determining if it can start.

Active Gap Offset Cast Radius

The radius of the cast when determining if a gap exists and the ability is active.

Start Move Towards Wall Speed

The speed that the character should move towards the wall when starting.

Stop Force

The amount of force to apply when the ability stops from input or the jump ability. This will push the character away from the wall.

Stop Force Frames

The number of frames to apply the force in when the ability stops from input or the jump ability. This will push the character away from the wall.

Author the ledge and wall

Use a continuous wall collider and keep its distance from the ledge consistent. Sharp wall details can change the detected normal and visibly rotate the character. The open side of the ledge must remain clear inside the gap casts; invisible barriers or wide trim can make the route look valid while preventing the ability from recognizing the drop.

Detect Wall Distance finds the wall. Horizontal Start Offset expands the initial search left and right. Wall Offset controls the active root distance, while Gap Offset places the ledge-gap query away from the wall. Tune them in that order so the gap cast is based on the final wall alignment.

The gap cast checks for empty space at Gap Offset. Can Start Gap Offset Cast Radius controls that clearance volume at entry; Active Gap Offset Cast Radius controls it while strafing. A larger radius can overlap more solid geometry and reject the gap. It does not extend support detection past the end of the ledge. Tune both radii against the actual width and nearby trim.

Stop Force and Stop Force Frames define the push away from the wall when input or Jump ends the ability. Test the result at both ends of the ledge and near adjacent geometry. If the character is pushed into the wall, verify the wall normal and sign of the intended exit before increasing the force.