RealDocs

UCharacterMovementComponent::K2_ComputeFloorDist

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

Description

Measures the distance from the base of the capsule at CapsuleLocation down to the floor, using a line trace and/or capsule sweep, and writes the result into FloorResult. Unlike K2_FindFloor(), this ignores whether the capsule's own collision is enabled.

Caveats & Gotchas

  • Unlike FindFloor()/K2_FindFloor(), this does not care whether the capsule has collision enabled, so it can return a floor result even when the character's own collision is off.
  • This Blueprint wrapper clamps LineDistance to SweepDistance and both to non-negative values for you; the underlying C++ ComputeFloorDist() does not perform that clamping.

Signature

virtual void K2_ComputeFloorDist(FVector CapsuleLocation, float LineDistance, float SweepDistance, float SweepRadius, FFindFloorResult& FloorResult) const

Parameters

Name Type Description Default
CapsuleLocation FVector Location of the capsule used for the query.
LineDistance float Max distance to test with a simple line trace from the capsule base; only used if the sweep fails to find a walkable floor.
SweepDistance float Max distance to sweep the capsule downward for the test.
SweepRadius float Radius to use for the sweep test; should be no greater than the capsule radius.
FloorResult FFindFloorResult& Out parameter that receives the result of the floor check.

Return Type

void

Example

Measure floor distance from a custom location Blueprint
Call Compute Floor Distance with a Capsule Location, Line Distance, Sweep Distance and Sweep Radius, then break the returned Find Floor Result to read Floor Dist.

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.