UCharacterMovementComponent::HandleWalkingOffLedge
#include "GameFramework/CharacterMovementComponent.h"
Access: public
Specifiers: virtual
Description
Called when the walking movement mode detects the character has walked off a ledge with no floor beneath it, and forwards an OnWalkingOffLedge notification to the owning Character.
Caveats & Gotchas
- • Default implementation only calls ACharacter::OnWalkingOffLedge — it does not itself change MovementMode; the subsequent fall into MOVE_Falling happens separately in the walking movement loop.
- • Only fires when transitioning off a ledge during MOVE_Walking, not when jumping or when explicitly setting MovementMode to falling.
- • Override this if you need extra bookkeeping (e.g. coyote-time timers) at the exact moment a character leaves solid ground, rather than polling MovementMode every tick.
Signature
virtual void HandleWalkingOffLedge(const FVector& PreviousFloorImpactNormal, const FVector& PreviousFloorContactNormal, const FVector& PreviousLocation, float TimeDelta); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| PreviousFloorImpactNormal | const FVector& | Impact normal of the floor the character was standing on before walking off it. | — |
| PreviousFloorContactNormal | const FVector& | Contact normal of the floor the character was standing on before walking off it. | — |
| PreviousLocation | const FVector& | Character location just before it walked off the ledge. | — |
| TimeDelta | float | Time step for the move that caused the character to walk off the ledge. | — |
Return Type
void Example
Starting a coyote-time window on ledge walk-off C++
void UMyCharacterMovementComponent::HandleWalkingOffLedge(const FVector& PreviousFloorImpactNormal, const FVector& PreviousFloorContactNormal, const FVector& PreviousLocation, float TimeDelta)
{
Super::HandleWalkingOffLedge(PreviousFloorImpactNormal, PreviousFloorContactNormal, PreviousLocation, TimeDelta);
CoyoteTimeRemaining = MaxCoyoteTime;
} Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?