UMovementComponent::SlideAlongSurface

Override Hierarchy

UMovementComponent::SlideAlongSurface()

UCharacterMovementComponent::SlideAlongSurface()

Syntax

virtual float SlideAlongSurface
(
    const FVector & Delta,
    float Time,
    const FVector & Normal,
    FHitResult & Hit,
    bool bHandleImpact
)

Remarks

Slide smoothly along a surface, and slide away from multiple impacts using TwoWallAdjust if necessary. Calls HandleImpact for each surface hit, if requested. Uses SafeMoveUpdatedComponent() for movement, and ComputeSlideVector() to determine the slide direction.

Returns

The percentage of requested distance (Delta * Percent) actually applied (between 0 and 1). 0 if no movement occurred, non-zero if movement occurred.

Parameters

Parameter

Description

Delta

Attempted movement vector.

Time

Percent of Delta to apply (between 0 and 1). Usually equal to the remaining time after a collision: (1.0 - Hit.Time).

Normal

Normal opposing movement, along which we will slide.

Hit

[In] HitResult of the attempted move that resulted in the impact triggering the slide. [Out] HitResult of last attempted move.

bHandleImpact

Whether to call HandleImpact on each hit.

References

Module

Engine

Header

Runtime/Engine/Classes/GameFramework/MovementComponent.h

Source

Runtime/Engine/Private/Components/MovementComponent.cpp