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.

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback