Appearance
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
| Function | Description |
|---|---|
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
| Function | Description |
|---|---|
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
| Phase | Behavior |
|---|---|
| Creation | Created when the local player is initialized |
| Registration | Motion components register during BeginPlay |
| Active | Query and coordination functions are available |
| Cleanup | Components unregister during EndPlay |
Next steps
Move from subsystem reference to usage and surrounding architecture.