Navigation
API > API/Runtime > API/Runtime/Engine > API/Runtime/Engine/UCharacterMovementComponent
Description
Updates Velocity and Acceleration based on the current state, applying the effects of friction and acceleration or deceleration. Does not apply gravity. This is used internally during movement updates. Normally you don't need to call this from outside code, but you might want to use it for custom movement modes.
| Name | CalcVelocity |
| 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 CalcVelocity
(
float DeltaTime,
float Friction,
bool bFluid,
float BrakingDeceleration
)
Parameters
| Name | Remarks |
|---|---|
| DeltaTime | time elapsed since last frame. |
| Friction | coefficient of friction when not accelerating, or in the direction opposite acceleration. |
| bFluid | true if moving through a fluid, causing Friction to always be applied regardless of acceleration. |
| BrakingDeceleration | deceleration applied when not accelerating, or when exceeding max velocity. |