UMovementComponent::SlideAlongSurface

Slide smoothly along a surface, and slide away from multiple impacts using TwoWallAdjust if necessary.

Windows
MacOS
Linux

Override Hierarchy

UMovementComponent::SlideAlongSurface()

UCharacterMovementComponent::SlideAlongSurface()

References

Module

Engine

Header

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

Include

#include "GameFramework/MovementComponent.h"

Source

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

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.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss