HomeSystem plugins › AFS_UX_Locomotion
System

AFS_UX_Locomotion

Smooth movement and snap or smooth turning as controller abilities, with camera- or controller-relative direction.

What it gives you

  • Thumbstick movement with configurable reference frame
  • Snap turn or smooth turn from one component
  • Per-hand input binding

Requires

AFM_Abilities AFM_Teleport

Required by

AFE_Showroom AF_Examples

4 assets13 API members

Description

Locomotion is two independent controller abilities, so you can put movement on one hand and turning on the other — the standard VR arrangement — without either knowing about the other.

BPC_ControllerAbility_Movement converts thumbstick input into world movement. Movement Direction decides the reference frame: relative to the camera means the player moves where they look, relative to the controller means they can steer with the hand independently of gaze, which some users find more comfortable.

BPC_ControllerAbility_Turn handles rotation. Setting Rotate Step Duration to zero gives a snap turn; a small non-zero value gives a quick smooth turn. Snap turning is the safer default for comfort.

Setup

  1. Enable AFS_UX_Locomotion.
  2. Add BPC_ControllerAbility_Movement to one motion controller and BPC_ControllerAbility_Turn to the other.
  3. Assign Mapping Contexts Default for the left and right hand.

Usage

Comfort settings

Expose Rotate Step Degree and Rotate Step Duration as game settings — see Add a setting. Comfort preferences vary enormously between users.

Blocking movement contextually

Call setAbilityRestriction on the pawn with the locomotion tag while a menu is open or an object is held.

The pawn mid-turn, snap-turn indicator on screen
AFS_UX_Locomotion_result.pngThe pawn mid-turn, snap-turn indicator on screen
The pawn mid-turn, snap-turn indicator on screen

Key properties

PropertyWhen to change
Movement DirectionCamera-relative or controller-relative steering
Movement SpeedOverall movement multiplier
Rotate Step DegreeSnap turn increment; 30–45° is typical
Rotate Step DurationZero for snap, small non-zero for quick smooth turn

Extending

Derive from either ability to add acceleration curves, dash movement or vignetting.

Performance notes

Performance

Movement calls Interface_RecenterCapsule each frame it moves, which keeps the capsule under the player. This is intentional and inexpensive.

Example map

Map_Examples_Locomotion demonstrates both abilities with configurable settings.

Troubleshooting

The player drifts away from the capsule. Interface_RecenterCapsule is not being called — it is invoked by movement, so custom movement code must call it too.

API reference

Every blueprint asset in this plugin. Expand an asset to see its members.

Components

BPC_ControllerAbility_Movement5 members
extends BPC_ControllerAbility
KindNameSignatureDescription
varMovementDirectionSettingsE_Locomotion_DirectionWhether the thumbstick moves the player relative to where they are looking or relative to where the controller points. Controller-relative allows steering with the hand independently of gaze.
varMovementSpeedSettingsfloatMultiplier applied to movement input.
varMapping Contexts DefaultInputST_MappingContext_SideInput mapping contexts applied for the left and right hand, so movement can be bound to a specific controller.
fngetControlDirection(Vector2D: Vector2D, out MovementVector: Vector)Converts a two-axis input into a world movement direction using the configured movement direction mode.
eventInitiateControllerAbility(Pawn: Pawn, MotionController: Actor, Side: E_Side)Sets up the movement ability once the owning motion controller is ready.
BPC_ControllerAbility_Turn6 members
extends BPC_ControllerAbility
KindNameSignatureDescription
varRotateStepDegreeSettingsfloatDegrees turned per snap turn input. Set to a small value for near-continuous turning.
varRotateStepDurationSettingsfloatHow long a turn takes, in seconds. Zero gives an instant snap turn, which is more comfortable for many players.
varMapping Contexts DefaultInputST_MappingContext_SideInput mapping contexts applied for the left and right hand.
varSound_TurnSoundSoundBaseSound played on each turn.
eventInitiateControllerAbility(Pawn: Pawn, MotionController: Actor, Side: E_Side)Sets up the turn ability once the owning motion controller is ready.
eventTurn(Side: E_Side)Turns the player one step in the given direction.

Helper

BP_Helper_ControllerAbility_Movement1 members
extends BP_Helper_ControllerAbility
KindNameSignatureDescription
varControllerAbilityBPC_ControllerAbility_MovementThe movement ability this helper visualises.
BP_Helper_ControllerAbility_Turn1 members
extends BP_Helper_ControllerAbility
KindNameSignatureDescription
varControllerAbilityBPC_ControllerAbility_TurnThe turn ability this helper visualises.