RealDocs

UCharacterMovementComponent::GetLedgeMove

function Engine Since 4.0
#include "GameFramework/CharacterMovementComponent.h"
Access: public Specifiers: virtualconst

Description

Computes a replacement move delta that slides the character along a ledge instead of walking off it, based on the original Delta and the last known floor.

Caveats & Gotchas

  • Returns FVector::ZeroVector if no valid sideways move is found via CheckLedgeDirection(), which callers must handle as 'no ledge slide available.'
  • The returned delta is a substitute for the original Delta, not an addition to it — apply it in place of the move that went over the ledge, not on top of it.
  • Purely a computation helper; it does not itself move the character or change MovementMode.

Signature

virtual FVector GetLedgeMove(const FVector& OldLocation, const FVector& Delta, const FFindFloorResult& OldFloor) const;

Parameters

Name Type Description Default
OldLocation const FVector& Location before the move that ended up going over a ledge.
Delta const FVector& The move delta that ended up going over the ledge.
OldFloor const FFindFloorResult& Floor result from before the move that went over the ledge.

Return Type

FVector

Example

Inspecting the ledge-slide delta in an override C++
FVector UMyCharacterMovementComponent::GetLedgeMove(const FVector& OldLocation, const FVector& Delta, const FFindFloorResult& OldFloor) const
{
	const FVector SlideDelta = Super::GetLedgeMove(OldLocation, Delta, OldFloor);
	UE_LOG(LogTemp, Verbose, TEXT("Ledge slide delta: %s"), *SlideDelta.ToString());
	return SlideDelta;
}

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.