UCharacterMovementComponent::MaxWalkSpeed
#include "GameFramework/CharacterMovementComponent.h"
Access: public
Specifiers: UPROPERTYEditAnywhereBlueprintReadWrite
Description
The maximum ground speed in cm/s when walking. Also caps lateral movement speed while the character is airborne (falling). Set this at runtime to implement sprinting, slow fields, or speed modifiers.
Signature
float MaxWalkSpeed Caveats & Gotchas
- • Default value is 600 cm/s. Unreal units are centimetres — 600 is roughly 6 m/s.
- • Changes take effect immediately when set at runtime. Safe to modify directly without going through a function.
- • Does not affect swimming or flying speed — those are controlled by MaxSwimSpeed and MaxFlySpeed respectively.
Example
Double walk speed during a sprint C++
void AMyCharacter::SetSprinting(bool bSprint)
{
if (UCharacterMovementComponent* Move = GetCharacterMovement())
{
Move->MaxWalkSpeed = bSprint ? 1200.f : 600.f;
}
} Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?