Navigation
API > API/Runtime > API/Runtime/Engine > API/Runtime/Engine/UCharacterMovementComponent
Description
Set a custom, local gravity direction to use during movement simulation. The gravity direction must be synchronized by external systems between the autonomous and authority processes. The gravity direction will be corrected as part of movement corrections should the movement state diverge. SetGravityDirection is responsible for initializing cached values used to tranform to from gravity relative space.
| Name | SetGravityDirection |
| Type | function |
| Header File | /Engine/Source/Runtime/Engine/Classes/GameFramework/CharacterMovementComponent.h |
| Include Path | #include "GameFramework/CharacterMovementComponent.h" |
| Source | /Engine/Source/Runtime/Engine/Private/Components/CharacterMovementComponent.cpp |
UFUNCTION (BlueprintCallable, Category="Pawn|Components|CharacterMovement")
virtual void SetGravityDirection
(
const FVector & GravityDir
)
Parameters
| Name | Remarks |
|---|---|
| GravityDir | A non-zero vector representing the new gravity direction. The vector will be normalized. |