Appearance
MotionSprintingComponent
MotionSprintingComponent handles sprint intent, sprint speed, optional stamina, client-predicted intent tags, and GAS-backed sprint state.
Requirements
- The character must have a standard
UCharacterMovementComponent. - Motion must find a
UAbilitySystemComponent. A PlayerState that implementsIAbilitySystemInterfacecan expose this component. - You must initialize the Gameplay Ability System.
- You must configure Enhanced Input.
- You must configure the sprint GameplayEffects for speed, stamina, sprint intent, and sprint state.
- You must configure GameplayTags for sprint intent, active sprinting, and optional stamina state.
For setup and input binding steps, see How to add Motion to a character.
Behavior
The component turns sprint input into server-owned movement state. It validates whether sprint can start, applies speed and tag effects, and optionally drains stamina. On the locally controlled sprint transition, it starts camera feedback only when speed is already at least MinSprintVelocity. An owning client predicts the wants-to-sprint tag locally and sends the request to the server.
When stamina is enabled, the component can pause sprinting or start stamina recovery. It can also release input after stamina depletion. Hysteresis thresholds keep sprint start and sprint stop behavior stable.
Public API
Sprint state
SetWantsToSprint(bool bWantsToSprint) -> void: sets sprint intent.GetWantsToSprint() -> bool: returns sprint intent.IsCurrentlySprinting() -> bool: returns active sprint state.CanStartSprinting() -> bool: Returns true when sprint can start.
Stamina
GetStaminaFromGAS() -> float: reads rawStaminafrom GAS, or returns the current5.0fallback when the stamina system or attribute is unavailable.GetCurrentStamina() -> float: ReturnsStamina / MaxStaminawhen the two attributes are available andMaxStaminais positive. For other conditions, it returns1.0.
Speed and movement
GetCurrentMovementSpeed() -> float: returns current speed.IsActuallyMoving() -> bool: Returns true when velocity is sufficient for movement.
Camera and input
HandleSprintInputStateChange(bool bPressed) -> void: processes sprint input state.
Prediction and networking
IsLocallyPredicting() -> bool: returns the inherited prediction flag. Current sprint code sets it after authoritative sprint-speed effect application or removal on a locally controlled authority instance.GetLocalPredictedSpeed() -> float: returns the corresponding target speed recorded by that authoritative path.
Protected/Internal Behavior
The component owns sprint state updates, stamina effect management, speed-effect application, camera feedback, and stamina attribute callbacks internally. These hooks are protected implementation details, not public Blueprint API:
UpdateSprintingState(float DeltaTime) -> voidUpdateStamina(float DeltaTime) -> voidUpdateStaminaWithGameplayEffects(float DeltaTime) -> voidOnStaminaAttributeChanged(const FOnAttributeChangeData& Data) -> voidOnStaminaDepleted(float CurrentStaminaValue) -> voidApplySprintSpeedModification() -> voidRemoveSprintSpeedModification() -> voidStartSprintCameraEffects() -> voidStopSprintCameraEffects() -> voidServerRequestSprint(bool bWantsToSprint) -> void: protected server RPC for sprint validation.
Configuration
Configuration is in the assigned MotionSprintProfile. The default Motion profile for this release is /MotionCore/Motion/Profiles/v2_0_0/DA_MotionSprintProfile_Default_v2_0_0.
Sprint settings
SprintWalkSpeedModifier: walk speed value added while sprinting. Default:300.0.bRequiresContinuousInput: Specifies whether the input must stay active. The default istrue.BaseWalkSpeed: This is the fallback base speed for sprint target calculations without aMotionWalkComponent. The default is600.0. With a Walk Component, sprinting uses the profile-appliedBaseWalkSpeedof that component.
Stamina settings
bUseStaminaSystem: Specifies whether stamina limits sprinting. The default istrue.MinStaminaToSprint: raw stamina necessary to start sprinting. Default:1.5.MinStaminaToStopSprinting: minimum stamina to continue sprinting. Default:0.25.MinSprintVelocity: minimum velocity for sprint camera shake. Default:50.0.RegenDelayDuration: time to block regeneration after exhaustion. Default:2.0.bForceReleaseOnStaminaDepletion: Specifies whether depletion clears sprint intent. The default istrue.
Effects and tags
SprintCameraShake: camera curve used while sprinting.bApplyCameraShake: Specifies whether Motion applies sprint camera shake.SprintSpeedEffect: speed modifier effect.SprintStaminaDrainEffect: stamina drain effect.StaminaRegenEffect: stamina regeneration effect.StaminaRegenDelayEffect: post-exhaustion regeneration delay.WantsToSprintTagEffect: grants wants-to-sprint tag.SprintingTagEffect: grants sprinting state tag.
The primary setting that you edit is the Profile reference. Runtime prediction, stamina handles, replicated state, and diagnostics stay on the component.
Runtime State
These values are protected component state. Use the public prediction getters when they are available.
SprintCameraShakeIdentifier: identifier for sprint camera shake.bIsLocallyPredicting: Inherited flag set after authoritative speed-effect application or removal on a locally controlled authority instance. Sprint code in this release does not clear it.LocalPredictedSpeed: last sprint or base-speed target recorded by that path.
Blueprint Events
OnSprintStateChangedDelegate(bool bIsSprinting): fires when sprint state changes.OnSprintStaminaDepletedDelegate(): fires when stamina is depleted.OnStaminaFullyRecoveredDelegate(): fires when stamina gets to maximum.OnStaminaChangedDelegate(float NewStamina, float MaxStamina): fires when stamina changes.
Networking
The owning client immediately adds or removes a loose wants-to-sprint tag and sends ServerRequestSprint. The server rate-limits requests and rejects sprint starts with insufficient stamina. It owns sprint tag, speed, drain, regeneration, and regeneration-delay GameplayEffects. GAS replication sends authoritative tags and attributes. Camera feedback remains local to the owning view.