MotionWalkComponent
Manages base walking mechanics, movement direction analysis, and walking state to provide foundation for character locomotion. This component serves as the foundation for all movement components, providing core movement analysis and speed control.
Requirements
- Character with
UCharacterMovementComponent(by default it should have one) - MotionPlayerState configured in GameMode
- Gameplay Ability System (GAS) initialized
- Gameplay Effects:
GE_Motion_WalkSpeed- Modifies walk speed attributeGE_Motion_Walking- Grants walking state tag
- Gameplay Tags:
Motion.State.Walking- Active when character is walkingAttribute.Movement.WalkSpeed- Movement speed attribute tag
Installation
- Add
UMotionWalkComponentto your Character Blueprint or C++ class - Configure the component properties in the Details panel
- Set the
WalkingTagEffecttoGE_Motion_Walking - Set the
WalkSpeedEffecttoGE_Motion_WalkSpeed - Configure
BaseWalkSpeedto match your AttributeSet default (typically 600) - Enable
bApplyCameraEffectsif you want subtle camera movement during walking


Functionality
Main Update Flow
Expandability
The MotionWalkComponent provides numerous virtual functions for customization:
Core Walking Functions
| Function | Parameters | Returns | Use Case Examples |
|---|---|---|---|
IsCurrentlyWalking() | None | bool | • Add terrain restrictions • Check stamina requirements |
GetDirectionalSpeedMultiplier() | None | float | • Combat stance modifiers • Encumbrance system |
UpdateWalkingState() | float DeltaTime | void | • Custom state transitions • Add walking conditions |
Movement Analysis Functions
| Function | Parameters | Returns | Use Case Examples |
|---|---|---|---|
CalculateMovementDirection() | None | FMotionMovementDirection | • 8-way movement • Analog stick deadzone |
UpdateMovementDirection() | float DeltaTime | void | • Smooth direction changes • Add turn lag |
UpdateMovementSpeed() | float DeltaTime | void | • Acceleration curves • Speed ramping |
HasMovementDirectionChanged() | NewDir, OldDir | bool | • Adjust sensitivity • Filter small changes |
Speed Modification Functions
| Function | Parameters | Returns | Use Case Examples |
|---|---|---|---|
ApplyDirectionalSpeedMultipliers() | float DeltaTime | void | • Surface-based speed • Weather effects |
ApplyWalkSpeedModification() | None | void | • Buff/debuff system • Equipment bonuses |
RemoveWalkSpeedModification() | None | void | • Clear status effects • Reset to base speed |
Camera Effect Functions
| Function | Parameters | Returns | Use Case Examples |
|---|---|---|---|
StartWalkCameraEffects() | None | void | • Custom camera shake • View bobbing intensity |
StopWalkCameraEffects() | None | void | • Smooth camera reset • Transition effects |
GenerateCurveIdentifier() | None | FString | • Unique effect IDs • Multi-component support |
Utility Functions
| Function | Parameters | Returns | Use Case Examples |
|---|---|---|---|
InitializeComponent() | None | void | • Custom initialization • Additional caching |
PrintDebugInformation() | None | void | • Custom debug display • Performance metrics |
Blueprint Events
| Event | Parameters | Use Case Examples |
|---|---|---|
OnWalkingStateChanged | bool bIsWalking | • Footstep sounds • Animation triggers |
OnMovementDirectionChanged | FMotionMovementDirection NewDirection | • Turn animations • Lean adjustments |
OnMovementSpeedChanged | float NewSpeed, float SpeedPercentage | • UI speed indicator • Sound pitch variation |
Configuration
Walking Settings (FMotionWalkSettings)
| Property | Type | Default | Description | Range |
|---|---|---|---|---|
| MinWalkVelocity | float | 50.0 | Minimum velocity to be considered "walking" | 1.0 - 200.0 |
| ForwardSpeedMultiplier | float | 1.0 | Walking speed multiplier for forward movement | 0.1 - 2.0 |
| BackwardSpeedMultiplier | float | 0.7 | Walking speed multiplier for backward movement | 0.1 - 2.0 |
| StrafeSpeedMultiplier | float | 0.8 | Walking speed multiplier for strafing movement | 0.1 - 2.0 |
| bEnableDirectionalSpeedMultipliers | bool | true | Whether to apply directional speed multipliers | - |
Core Configuration
| Property | Type | Default | Description | Range |
|---|---|---|---|---|
| BaseWalkSpeed | float | 600.0 | Base walk speed used for all multiplier calculations | 100.0 - 2000.0 |
| bApplyCameraEffects | bool | true | Whether to apply camera effects during walking | - |
| WalkCameraEffect | FStructMotionCurve | - | Camera curve to apply during walking (subtle camera movement) | - |
| bWalkingEnabled | bool | true | Whether walking is currently enabled | - |
GAS Integration
| Property | Type | Description |
|---|---|---|
| WalkSpeedEffect | TSubclassOf<UGameplayEffect> | Gameplay effect to apply for walk speed modification |
| MovementSpeedAttributeTag | FGameplayTag | Gameplay tag for the movement speed attribute |
| WalkingTagEffect | TSubclassOf<UGameplayEffect> | Gameplay effect that grants the Motion.State.Walking tag |
Debug
| Property | Type | Default | Description |
|---|---|---|---|
| bShowDebugInformation | bool | false | Debug information display |
State Tracking (Read-Only)
| Property | Type | Description |
|---|---|---|
| CurrentMovementDirection | FMotionMovementDirection | Current movement direction data |
| WalkCameraEffectIdentifier | FString | Unique identifier for walk camera effect |
| bIsLocallyPredicting | bool | Whether component is in local prediction state |
| LocalPredictedSpeed | float | Locally predicted speed value |
| LastLocalPredictionTime | double | Timestamp of last prediction change |
Local Prediction
The component supports client-side prediction for responsive multiplayer gameplay:
Prediction State Management
Prediction API
- IsLocallyPredicting() - Check if in local prediction state
- GetLocalPredictedSpeed() - Get predicted speed value
- GetLastLocalPredictionTime() - Get timestamp of last prediction
Networking
The MotionWalkComponent handles networking through:
- Client-side prediction for immediate response
- Server validation for authoritative state
- GAS replication for synchronized effects
- Local-only camera effects for responsiveness without network overhead