Skip to content

MotionWalkComponent

MotionWalkComponent handles base walking state, movement speed, and direction analysis. It is the foundation that the other Motion movement components react to.

Requirements

  • ACharacter owner with a valid UCharacterMovementComponent
  • A resolvable UAbilitySystemComponent on the character or owning actor, commonly PlayerState
  • Gameplay Ability System initialized for the character/ASC pair
  • GE_Motion_WalkSpeed for authoritative walk speed changes
  • GE_Motion_Walking for the walking state tag
  • Motion.State.Walking and Attribute.Movement.WalkSpeed GameplayTags

MotionPlayerState is not required. For setup steps, see How to add Motion to a character.

Behavior

Each update, the component checks whether walking is enabled, analyzes velocity, updates movement direction, applies directional speed multipliers, manages GAS effects, and sends camera/event notifications when state changes.

Walking is active when velocity is above WalkSettings.MinWalkVelocity. Direction checks expose forward, backward, and strafing state for animation, camera, audio, and gameplay logic.

The assigned walk profile's BaseWalkSpeed is the base speed source when this component is present. During initialization, Motion applies it to CharacterMovementComponent->MaxWalkSpeed; when an ASC with a WalkSpeed attribute is available, the server writes the same value to the attribute base value and then syncs CMC from the current effective WalkSpeed.

Set base walking speed on the assigned walk profile. Do not use the CharacterMovementComponent walk speed setting as a separate base speed while the Walk Component is active, because Motion owns MaxWalkSpeed and later GAS speed effects build from the Motion value.

No custom CharacterMovementComponent subclass is required for this ownership model; Motion updates the standard CMC and GAS state directly.

API

Walking state

  • IsCurrentlyWalking() -> bool: returns whether the component currently considers the character walking.
  • UpdateWalkingState(float DeltaTime) -> void: updates walking state, GAS effects, and related events.
  • GetDirectionalSpeedMultiplier() -> float: returns the current movement-direction multiplier.

Movement analysis

  • CalculateMovementDirection() -> FMotionMovementDirection: calculates movement direction from current velocity.
  • UpdateMovementDirection(float DeltaTime) -> void: refreshes cached direction state.
  • UpdateMovementSpeed(float DeltaTime) -> void: refreshes cached speed state.
  • HasMovementDirectionChanged(NewDir, OldDir) -> bool: compares direction values.

Movement queries

  • GetMovementDirection() -> FMotionMovementDirection: returns current movement direction.
  • GetCurrentMovementSpeed() -> float: returns current movement speed.
  • GetMovementSpeedPercentage() -> float: returns speed as a normalized percentage.
  • IsMovingForward() -> bool: returns whether movement is forward.
  • IsMovingBackward() -> bool: returns whether movement is backward.
  • IsStrafing() -> bool: returns whether movement is sideways.

Speed and camera effects

  • ApplyDirectionalSpeedMultipliers(float DeltaTime) -> void: applies directional speed rules.
  • ApplyWalkSpeedModification() -> void: applies the walk speed effect. This is server-only.
  • RemoveWalkSpeedModification() -> void: removes the walk speed effect. This is server-only.
  • StartWalkCameraEffects() -> void: starts walking camera feedback.
  • StopWalkCameraEffects() -> void: stops walking camera feedback.
  • GenerateCurveIdentifier() -> FName: creates a unique curve identifier.

Utility

  • InitializeWalkComponent() -> void: initializes cached component references.
  • PrintDebugInformation() -> void: prints debug state when enabled.

Configuration

Configuration lives on the assigned MotionWalkProfile. The current Motion default is /MotionCore/Motion/Profiles/v2_0_0/DA_MotionWalkProfile_Default_v2_0_0.

FMotionWalkSettings

  • MinWalkVelocity: minimum velocity considered walking. Default: 50.0.
  • ForwardSpeedMultiplier: multiplier for forward movement. Default: 1.0.
  • BackwardSpeedMultiplier: multiplier for backward movement. Default: 0.7.
  • StrafeSpeedMultiplier: multiplier for strafing. Default: 0.8.
  • bEnableDirectionalSpeedMultipliers: whether directional multipliers are applied. Default: true.

Profile fields

  • BaseWalkSpeed: authoritative base walk speed used for initialization, attribute sync, and multiplier calculations. Default: 600.0.
  • bApplyCameraEffects: whether walking camera effects are applied. Default: true.
  • WalkCameraEffect: camera curve used for walking feedback.
  • WalkSpeedEffect: GameplayEffect used for walk speed modification.
  • WalkingTagEffect: GameplayEffect that grants Motion.State.Walking.

The component's editable setup surface is the Profile reference. Runtime and diagnostic state remains component-owned.

Read-Only State

  • CurrentMovementDirection: current movement direction data.
  • WalkCameraEffectIdentifier: unique identifier for the active walk camera effect.

Blueprint Events

  • OnWalkingStateChanged(bool bIsWalking): fires when walking state changes.
  • OnMovementDirectionChanged(FMotionMovementDirection NewDirection): fires when movement direction changes.
  • OnMovementSpeedChanged(float NewSpeed, float SpeedPercentage): fires when movement speed changes.

Networking

The component uses client-side prediction for local responsiveness, server validation for authoritative state, GAS replication for synchronized effects, and local-only camera effects for responsive presentation.

Motion - Advanced First Person Character Controller