Skip to content

UMotionSubsystem reference

UMotionSubsystem is a ULocalPlayerSubsystem that provides a local registry and coordination point for Motion components.

Overview

The subsystem is created for each local player and provides:

  • active Motion component registration
  • component queries
  • optional movement ability granting
  • lifecycle coordination for local-player-owned Motion systems

Access

Blueprint

C++

cpp
UMotionSubsystem* Subsystem = ULocalPlayer::GetSubsystem<UMotionSubsystem>(
    PlayerController->GetLocalPlayer()
);

Functions

Component queries

FunctionDescription
GetActiveComponents()Returns all registered Motion components for the local player
GetComponentByClass(ComponentClass)Returns a registered component matching the class, or nullptr
RegisterComponent(Component)Registers a Motion component
UnregisterComponent(Component)Removes a Motion component from the registry

Ability management

FunctionDescription
GrantMovementAbilities(ASC)Grants configured movement abilities to an ASC
RemoveMovementAbilities(ASC)Removes previously granted movement abilities from an ASC

By default, GrantMovementAbilities() grants nothing. Projects can provide abilities by subclassing UMotionSubsystem or configuring the relevant data asset.

Multiplayer

Grant and remove abilities on the server when the abilities must replicate.

Lifecycle

PhaseBehavior
CreationCreated when the local player is initialized
RegistrationMotion components register during BeginPlay
ActiveQuery and coordination functions are available
CleanupComponents unregister during EndPlay

Next steps

Move from subsystem reference to usage and surrounding architecture.

Motion - Advanced First Person Character Controller