UCharacterMovementComponent::CalcVelocity

Updates Velocity and Acceleration based on the current state, applying the effects of friction and acceleration or deceleration.

Windows
MacOS
Linux

References

Module

Engine

Header

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

Include

#include "GameFramework/CharacterMovementComponent.h"

Source

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

Syntax

virtual void CalcVelocity
(
    float DeltaTime,
    float Friction,
    bool bFluid,
    float BrakingDeceleration
)

Remarks

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.

Parameters

Parameter

Description

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.

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