Stop Movement Animation prevents a character from running in place or applying horizontal root motion while movement input points into a blocking wall or an active Restrict Position boundary. Use it when the locomotion animation should return to idle before collision resolution holds the character in place.

Before you begin

  • Keep both Start Type and Stop Type set to Manual. The ability uses those defaults because it starts and stops itself from its collision prediction; it does not need an input name.
  • The obstacle must be included in the Layer Manager Solid Object Layers. Trigger Colliders are not solid obstacles for this check.
  • The ability intentionally ignores a dynamic, non-kinematic Rigidbody so a character can continue its movement animation while pushing a movable object.
  • Walkable slopes, obstacles below Max Step Height, and wall contacts accepted by the locomotion Wall Glide Curve do not start the ability.
  • Place Stop Movement Animation near the bottom of the Abilities list. It is concurrent, but its late update position lets it clear input and horizontal movement after abilities above it have made their changes.

Add Stop Movement Animation

  1. Select the character GameObject.
  2. In Ultimate Character Locomotion, expand Abilities.
  3. Select + and add Stop Movement Animation.
  4. Drag it near the bottom of the list, below stored-input abilities such as Quick Start, Quick Stop, and Quick Turn and below concurrent movement modifiers that it must override.
  5. Select the ability and keep Enabled selected, Start Type set to Manual, and Stop Type set to Manual.
  6. Set Collision Check Distance. The Version 3 default is 0.1.
  7. Set Wall Glide Curve Threshold. The default is 0.1.
  8. Keep Ability Index Parameter at -1 unless a custom Animator Controller intentionally needs a separate blocked-movement state. The supplied behavior uses normal locomotion parameters instead.
  9. Enter Play Mode and hold movement input directly into a solid, non-walkable wall.

Do not change the lifecycle selectors to Automatic. An automatic start would try to activate without first using this ability’s predictive collision check, and an automatic stop would run before its active update can clear the movement values.

Choose the collision prediction

Collision Check Distance

Collision Check Distance is the distance of a character collision cast in the current movement-input direction. Increase it when a fast or strongly root-motion-driven character must stop its animation earlier. Reduce it when the character returns to idle too far from a wall or hesitates near corners.

The cast direction is normalized after the input has passed the minimum input check, so the distance is not shortened by a partially tilted stick. Test analog input as well as full keyboard input.

The prediction accepts only a hit that should truly block horizontal movement:

  • A surface at or below the locomotion Slope Limit remains walkable.
  • A hit point above the character base but no higher than Max Step Height remains stepable.
  • A dynamic, non-kinematic Rigidbody remains pushable.
  • A wall contact whose Wall Glide Curve output exceeds the configured threshold remains glidable.
  • Other solid hits are treated as blocking.

Wall Glide Curve Threshold

Stop Movement Animation evaluates the Wall Glide Curve from Ultimate Character Locomotion for the current approach angle. If the curve’s output is greater than Wall Glide Curve Threshold, the character is allowed to glide and the ability remains inactive.

  • Lower the threshold when more angled contacts should keep their locomotion animation and glide along the wall.
  • Raise the threshold when more contacts should be treated as blocked and return to idle.
  • Tune the locomotion Wall Glide Curve first when the physical glide itself is wrong; use this threshold to decide when the animation should stop.

Restrict Position boundaries

When Restrict Position is present and active, Stop Movement Animation also tests the predicted target against that boundary. A restricted target starts this ability even though no wall Collider exists. Keep Stop Movement Animation below Restrict Position when both can change the final movement.

How Stop Movement Animation runs

While inactive, the ability checks for meaningful movement input and predicts the short move in that direction. A blocking collision or restricted target starts the ability through the normal ability controller.

While active, the same prediction runs every update. If the path remains blocked, the ability clears the locomotion Input Vector before the Animator update. This drives Horizontal Movement and Forward Movement toward zero and changes Moving to false. During position application, it also removes the character-relative horizontal components of Desired Movement while preserving the vertical component and rotation.

This second movement safeguard is important for root-motion characters. The input direction predicts the obstruction before the next animation movement is available, and the active ability removes horizontal root-motion displacement that would otherwise carry the character into the wall.

Stop Movement Animation is concurrent and has no dedicated animation by default. Its Ability Index Parameter is -1, and it does not override root-motion, gravity, or rotation settings. The visible result comes from the standard locomotion parameters returning the Animator to its nonmoving state.

Starting this ability stops any active ability derived from StoredInputAbilityBase and blocks another one from starting while the collision remains. In Version 3, this includes Quick Start, Quick Stop, and Quick Turn. When the obstruction clears, Stop Movement Animation stops immediately and resets their stored input history so a stale movement sample does not trigger an animation.

The inherited State field is empty by default. Assign a State only when the project needs a property change for the duration of the blocked movement. The included demo also demonstrates a DisableStopMovementAnimation State preset for areas where this prediction should be turned off.

Verify in Play Mode

  1. Open the Animator window and watch Horizontal Movement, Forward Movement, and Moving while keeping the active Abilities list visible.
  2. Hold forward input into a solid wall with an approach angle that cannot glide. Stop Movement Animation should become active, Moving should become false, and both movement parameters should settle at zero.
  3. Confirm the character does not advance horizontally into the wall. Repeat with root-motion position enabled and verify that the animation also cannot push the character through it.
  4. Turn away from the wall without releasing input. The ability should stop immediately, the movement parameters should recover, and locomotion should resume.
  5. Approach the same wall at a glancing angle accepted by Wall Glide Curve. The ability should remain inactive while the character moves along the surface.
  6. Walk onto a ramp within Slope Limit and over a step within Max Step Height. Neither should be mistaken for a blocking wall.
  7. Push a dynamic Rigidbody. Stop Movement Animation should remain inactive for that hit.
  8. Add and activate Restrict Position, remove any physical wall from the boundary, and hold input through the limit. The animation and horizontal movement should stop at the invisible boundary.
  9. Build movement history for Quick Start, Quick Stop, or Quick Turn, then press into the wall. Confirm the active stored-input ability stops and no stale transition plays when the wall is cleared.

Troubleshooting

Symptom Check Fix
The ability never becomes active Enabled, both lifecycle selectors, Collision Check Distance, input magnitude, and Solid Object Layers. Restore Manual start and stop, increase the distance slightly, and test a static or kinematic wall on a solid layer.
The character returns to idle too far from the wall The cast distance is longer than the character needs. Reduce Collision Check Distance and retest at the highest expected movement speed.
The character freezes instead of gliding along an angled wall The Wall Glide Curve output does not exceed Wall Glide Curve Threshold. Lower the threshold or adjust the locomotion Wall Glide Curve so that approach angle is glidable.
The character glides when it should stop The threshold is too low for the current Wall Glide Curve. Raise Wall Glide Curve Threshold until the intended contact is treated as blocking.
A ramp or curb stops the animation The surface normal exceeds Slope Limit, the hit is above Max Step Height, or the collision geometry has a vertical seam. Correct those locomotion settings or simplify the Collider so the surface is recognized as walkable or stepable.
A pushable object does not stop the animation Its Rigidbody is dynamic and non-kinematic. This is intentional. Make the obstacle kinematic or use different gameplay logic when it should behave as a fixed blocker.
Restrict Position stops movement but the animation keeps playing Restrict Position is missing, inactive, or later movement logic restores the input after this ability runs. Confirm Restrict Position is active and place Stop Movement Animation near the bottom of the list.
Stop Movement Animation is active but a custom Animator still runs The custom controller uses raw input or another parameter instead of the standard processed movement values. Drive the locomotion blend with Horizontal Movement, Forward Movement, and Moving, or clear the custom parameter in the same blocked state.
Root motion still nudges the character into the wall A later concurrent ability rewrites Desired Movement, or the prediction starts too late. Move Stop Movement Animation lower and increase Collision Check Distance slightly.
Quick Start, Quick Stop, or Quick Turn does not play near a wall Stop Movement Animation is active and deliberately blocks stored-input abilities. Correct the false-positive collision or disable this ability with a State in the area where the stored-input animation should win.
  • Restrict Position creates the invisible movement boundary this ability can detect.
  • Quick Start, Quick Stop, and Quick Turn are the stored-input abilities stopped and reset while movement is blocked.
  • Abilities explains concurrent updates, list order, States, and active ability inspection.
  • Animator Parameters documents Horizontal Movement, Forward Movement, Moving, and Ability Index.
  • Layer Manager defines the solid layers used by the prediction cast.

Developer reference

The released Version 3 StopMovementAnimation API exposes CollisionCheckDistance and WallGlideCurveThreshold. IsConcurrent returns true. The configured defaults are Manual start, Manual stop, CollisionCheckDistance = 0.1, WallGlideCurveThreshold = 0.1, and Ability Index Parameter -1.

Its internal collision test first rejects input below the locomotion Collider Spacing threshold. It checks an active RestrictPosition, then uses SingleCast against Solid Object Layers. It rejects dynamic non-kinematic Rigidbodies, walkable slopes, glidable contacts, and step-height hits before accepting the collision.

ShouldStopActiveAbility stops StoredInputAbilityBase instances when this ability starts, and ShouldBlockAbilityStart prevents those abilities from starting while it remains active. ApplyPosition clears local X and Z from DesiredMovement. Stopping sends OnStoredInputAbilityResetStoredInputs.

Normal activation and deactivation are reported through OnCharacterAbilityActive(Ability, bool). There is no feature-specific public collision event. Although the lifecycle type is Manual, external code normally should not start this ability directly: InactiveUpdate owns its prediction timing, and the inherited CanStartAbility() does not repeat the collision test for an arbitrary manual start.