RealDocs

UCharacterMovementComponent::GetMaxBrakingDeceleration

function Engine Blueprint Since 4.0
#include "GameFramework/CharacterMovementComponent.h"
Access: public Specifiers: UFUNCTIONBlueprintCallablevirtual

Description

Returns the maximum deceleration for the current state when braking, i.e. when there is no acceleration input.

Caveats & Gotchas

  • Selects between BrakingDecelerationWalking, BrakingDecelerationFalling, BrakingDecelerationSwimming, and BrakingDecelerationFlying based on MovementMode — changing MaxAcceleration alone has no effect on braking.
  • Returns 0 for MOVE_Custom and MOVE_None, so custom movement modes must override this or the character simply won't decelerate when input stops.

Signature

virtual float GetMaxBrakingDeceleration() const

Return Type

float

Example

Use in a custom deceleration curve C++
const float Braking = GetCharacterMovement()->GetMaxBrakingDeceleration();
const float StopTime = GetVelocity().Size() / FMath::Max(Braking, 1.f);

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.