UCharacterMovementComponent::ShouldCheckForValidLandingSpot
#include "GameFramework/CharacterMovementComponent.h"
Access: public
Specifiers: virtual
Description
Determines whether an impact during falling movement hit the edge of a surface, such that a downward sweep might find a walkable landing spot above the edge rather than treating the hit as a wall.
Caveats & Gotchas
- • Only returns true when the hit's Normal and ImpactNormal differ significantly — a flat wall hit where they match always returns false here, regardless of DeltaTime or Delta.
- • DeltaTime and Delta are accepted but unused by the base implementation; they exist so subclasses can override with velocity- or timestep-dependent logic.
Signature
virtual bool ShouldCheckForValidLandingSpot(float DeltaTime, const FVector& Delta, const FHitResult& Hit) const Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| DeltaTime | float | Time step for the current movement update. | — |
| Delta | const FVector& | The move delta that produced the hit. | — |
| Hit | const FHitResult& | Hit result from the falling-movement impact. | — |
Return Type
bool Example
Decide whether to re-check the landing spot after an edge hit C++
if (ShouldCheckForValidLandingSpot(deltaTime, Delta, Hit))
{
const FVector PawnLocation = UpdatedComponent->GetComponentLocation();
FFindFloorResult FloorResult;
FindFloor(PawnLocation, FloorResult, false);
if (FloorResult.IsWalkableFloor())
{
ProcessLanded(FloorResult.HitResult, deltaTime, Iterations);
}
} Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?