Choose your operating system:
Windows
macOS
Linux
| UMovementComponent::SlideAlongSurface()
|
Module |
|
Header |
/Engine/Source/Runtime/Engine/Classes/GameFramework/MovementComponent.h |
Include |
#include "GameFramework/MovementComponent.h" |
Source |
/Engine/Source/Runtime/Engine/Private/Components/MovementComponent.cpp |
virtual float SlideAlongSurface
(
const FVector & Delta,
float Time,
const FVector & Normal,
FHitResult & Hit,
bool bHandleImpact
)
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.
The percentage of requested distance (Delta * Percent) actually applied (between 0 and 1). 0 if no movement occurred, non-zero if movement occurred.
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. |