UCharacterMovementComponent::ComputePerchResult

Compute the sweep result of the smaller capsule with radius specified by [GetValidPerchRadius()](API\Runtime\Engine\GameFramework\UCharacterMovementComponent\GetValidPerchRadius), and return true if the sweep contacts a valid walkable normal within InMaxFloorDist of InHit.ImpactPoint.

Choose your operating system:

Windows

macOS

Linux

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Classes/GameFramework/CharacterMovementComponent.h

Include

#include "GameFramework/CharacterMovementComponent.h"

Source

/Engine/Source/Runtime/Engine/Private/Components/CharacterMovementComponent.cpp

Syntax

virtual bool ComputePerchResult
(
    const float TestRadius,
    const FHitResult & InHit,
    const float InMaxFloorDist,
    FFindFloorResult & OutPerchFloorResult
) const

Remarks

Compute the sweep result of the smaller capsule with radius specified by GetValidPerchRadius(), and return true if the sweep contacts a valid walkable normal within InMaxFloorDist of InHit.ImpactPoint. This may be used to determine if the capsule can or cannot stay at the current location if perched on the edge of a small ledge or unwalkable surface.

Only returns a valid result if ShouldComputePerchResult returned true for the supplied hit value.

Returns

True if the current location is a valid spot at which to perch.

Parameters

Parameter

Description

TestRadius

Radius to use for the sweep, usually GetValidPerchRadius().

InHit

Result of the last sweep test before the query.

InMaxFloorDist

Max distance to floor allowed by perching, from the supplied contact point (InHit.ImpactPoint).

OutPerchFloorResult

Contains the result of the perch floor test.