Move Towards Location
Use Move Towards Location to define where a character must stand and face before Interact, Drive, Ride, or another location-aware ability begins.
The component defines an arrival pose and its acceptable position and rotation range. It does not move the character by itself; the character’s Move Towards ability performs the approach and hands control to the requested ability after arrival.
Before you begin
- Add Move Towards to the character’s Ultimate Character Locomotion component.
- Keep one Move Towards ability on the character. The controller stores a single special Move Towards reference for this handoff.
- Place Move Towards above the ability it prepares in the Abilities list. If pathfinding is used, place NavMeshAgent Movement above Move Towards.
- Confirm that the waiting ability actually returns Move Towards Location components. Interact reads locations from the exact Interactable GameObject; Drive and Ride read locations from their source hierarchies.
Place an arrival location
This example positions the character for a button interaction:
- Select the same GameObject that contains Interactable. Interact does not search its children for Move Towards Location.
- Add the Move Towards Location component.
- Position and rotate the GameObject as a stable reference for the button. Alternatively, keep the existing Transform and use Offset and Yaw Offset to place the arrival pose relative to it.
- Select the component and inspect its Scene view gizmo. The green arrow shows the target facing direction. Move the orange arrival point in front of the button and point the arrow toward the button.

- Keep Size at
(0, 0, 0)for predictable point-based arrival. The orange wire box visualizes the editor’s Size setting, but a nonzero rotated box does not match the current runtime test; see the limitation below. - Set Distance for positional tolerance and Angle for the accepted facing arc. The translucent green arc represents the full Angle around the target direction.

- Keep Require Grounded enabled for a normal floor interaction. Disable it only when an airborne or freely positioned character must match the vertical target too.
- Keep Precision Start enabled when the next animation must begin from a settled pose. Disable it when the immediate handoff matters more than waiting for the final Animator transition.
- Add another Move Towards Location component when the object has several valid approach points. Move Towards chooses the closest returned location when none is already valid.
For Drive or Ride, a dedicated child GameObject is often clearer because those abilities collect locations below their source. Follow the owning ability’s page for its exact source hierarchy and any collider-clearance requirements.
Connect the character ability
- Select the character and expand Ultimate Character Locomotion > Abilities.
- Add Move Towards if it is missing.
- Keep its Start Type set to Manual. The controller or gameplay code starts it; it is not a player-input ability.
- Order optional pathfinding above Move Towards, Move Towards above Interact or another waiting ability, and lower-priority actions below them.
- Trigger the waiting ability normally. When that ability returns one or more Move Towards Location components, the controller starts Move Towards first if the character is not already inside a valid arrival pose.
There are no location IDs to match
Released UCC Version 3.2.0 has no ID field on Move Towards Location and no matching location ID on Move Towards. The handshake uses component references returned by Ability.GetMoveTowardsLocations().
Do not match the Interact ability’s Interactable ID, inherited Object ID, Ability Index, or an Object Identifier to Move Towards Location. Those values select targets or animation branches; they do not connect an arrival location. For Interact, the connection is the location component being on the same GameObject as the selected Interactable. For a custom ability, the connection is its GetMoveTowardsLocations() return value.
Ability-list position is an index used for priority, not a location ID. Move Towards warns when it is below the waiting ability because that higher-priority ordering can interrupt the intended handoff.
Choose the arrival settings
| Setting | Version 3.2.0 default | Result |
|---|---|---|
| Offset | (0, 0, 1) |
Target position in the component GameObject’s local space. Moving or rotating that GameObject moves the target pose. |
| Yaw Offset | 180 |
Target facing around the component’s local Y axis. This replaces the stale Rotation Offset name from older documentation. |
| Size | (0, 0, 0) |
Optional per-axis direction masking. The rotated gizmo box is not an exact runtime acceptance region; keep zero for precise arrival. |
| Distance | 0.01 |
Tolerance applied to the direction remaining after Size masking. Runtime does not subtract a Size half-extent before applying this tolerance. The Inspector range is 0.0001 to 100. |
| Angle | 0.5 |
Full accepted facing arc in degrees. Runtime validation allows half this value to either side of the target direction. 360 accepts any facing. |
| Require Grounded | Enabled | Requires the locomotion controller to be grounded. With this enabled, grounded state replaces the vertical Distance check; horizontal arrival is still checked. |
| Precision Start | Enabled | Stops residual movement and waits for the base Animator layer to leave transitions before the waiting ability starts. |
| Movement Multiplier | 1 |
Scales only this location’s approach input. It combines with Move Towards Input Multiplier and an active Speed Change multiplier. |
Start with Size zero, then widen Distance or Angle only as far as the next animation allows. A button press may need a narrow facing arc; a pickup without contact animation can accept more tolerance.
For nonzero Size, runtime rotates the Size vector and uses its resulting world components to decide whether to zero each target-direction component. It does not test the rotated box drawn by the gizmo. For example, yaw 45 degrees with Size (2, 0, 2) collapses one horizontal allowance to approximately zero even though the gizmo shows a square. Remaining direction components are tested against Distance without subtracting the Size half-extent. Use Size zero when editor/runtime agreement is required; a rotated-area workflow needs a corrected runtime calculation.
How the handoff runs
- The player or code tries to start Interact, Drive, Ride, or another ability.
- Ultimate Character Locomotion asks that ability for
GetMoveTowardsLocations(). - With no returned location, the requested ability continues normally. If any returned location already accepts the character’s position and rotation, Move Towards also stays inactive and the requested ability continues.
- Otherwise, Move Towards selects the closest returned location. It records the requested ability as On Arrive Ability and starts its own manual ability lifecycle.
- If an active Pathfinding Movement ability is configured above it, Move Towards supplies the destination to pathfinding. Otherwise it generates direct positional input. It rotates the character toward Target Rotation and temporarily forces independent look control.
- Position is accepted from Size, Distance, and Require Grounded. Rotation is accepted inside half the configured Angle on each side of Yaw Offset.
- With Precision Start enabled, Move Towards resets remaining movement and rotation and waits for the final settling frames, Animator layer-zero transitions, and Item Equip Verifier handoff.
- Move Towards stops, releases look and optional input control, stops its active pathfinding ability, and then starts the waiting ability.
Move Towards records the target position when it begins. Its Moving Target Distance Timeout can stop the approach when the location moves farther than that configured limit. If the character makes no movement or rotation progress for Inactive Timeout, the same early-stop path runs. Teleport On Early Stop decides whether the character is placed at the target and the waiting ability starts, or whether the pending action is cancelled.
If Move Towards is forcibly stopped for another reason, it clears the pending On Arrive Ability rather than starting it.
Editor checkpoint
Before entering Play Mode, confirm that:
- the character has exactly one enabled Move Towards ability;
- optional pathfinding is above Move Towards and Move Towards is above the waiting ability;
- the location is on the exact GameObject or hierarchy returned by that ability;
- the Scene view arrow faces the direction the character should face;
- Size is zero for exact point-based arrival, or its runtime behavior has been tested independently of the orange box; the green Angle arc permits the intended facing;
- Distance, Require Grounded, and Precision Start match the animation; and
- no target, ability, or Object Identifier ID is being used as a nonexistent location-ID link.
Verify in Play Mode
- With Size zero, start outside the target’s Distance tolerance and trigger the waiting ability.
- Select the character and confirm (Active) appears beside Move Towards while Interact or the other requested ability remains pending.
- Confirm the character approaches the selected location and faces the Scene view arrow direction.
- Enter the valid position but face outside the green arc. Confirm the waiting ability does not begin until the character finishes turning.
- With Precision Start enabled, confirm movement settles before the next animation begins. Disable it and repeat only if the design needs an immediate handoff.
- When several locations exist, approach from different sides and confirm the closest valid location is selected.
- For a grounded location, step or fall near the target and confirm the handoff waits until the character is grounded.
- Block the route longer than Move Towards Inactive Timeout and confirm the result matches Teleport On Early Stop.
- If the target can move, move it beyond Moving Target Distance Timeout and verify the same early-stop policy.
Troubleshooting
| Symptom | Check | Fix |
|---|---|---|
| The requested ability starts immediately without moving. | It may return no locations, or the character may already satisfy a location’s runtime position and rotation checks. | Put the component in the returned hierarchy, use Size zero for an exact point, and tighten Distance or Angle if the current pose should not count as arrived. |
| Interact finds the object but ignores its location. | Interact reads Move Towards Location components from the exact Interactable GameObject. | Move or duplicate the component onto that GameObject instead of a child. |
| The character moves toward the wrong side. | Check the component Transform, Offset, and Yaw Offset in the Scene view. | Reposition the Offset and point the green arrow toward the intended facing direction. |
| The character reaches the point but the next ability never starts. | Check Angle, Require Grounded, Precision Start, the base Animator layer for a continuing transition, and Item Equip Verifier. | Widen only the necessary threshold, restore a grounded pose, fix the transition, or disable Precision Start when a settled animation pose is not required. |
| The character uses the wrong one of several locations. | Move Towards chooses the closest target direction, not a location ID. | Reposition the locations or return only the locations that are valid for the current action. |
| The character walks directly through obstacles. | No Pathfinding Movement ability is active above Move Towards. | Add and configure NavMeshAgent Movement, bake the NavMesh, and keep it above Move Towards. |
| The character unexpectedly teleports to the target. | It stopped making progress for Inactive Timeout or the target exceeded Moving Target Distance Timeout, while Teleport On Early Stop was enabled. | Correct the obstruction or timeout, or disable teleporting so the pending action is cancelled. |
| Player input fights the automatic approach. | Move Towards Disable Gameplay Input is disabled. | Enable it when the approach should exclusively control movement; input is restored when Move Towards stops. |
| Adding matching IDs has no effect. | Move Towards Location has no location ID in Version 3.2.0. | Remove the assumed ID link and return the actual component from GetMoveTowardsLocations(). |
Related tasks
- Move Towards configures movement, pathfinding, timeouts, input control, and independent destinations.
- Interact returns locations from the exact Interactable GameObject.
- Drive uses child locations as vehicle entry points.
- Ride uses child locations for mounting and dismount clearance.
- NavMeshAgent Movement adds obstacle-aware routing before final alignment.
- Abilities explains list priority and the shared ability lifecycle.
- New Ability shows how to add a custom ability that can return arrival locations.
Developer reference
Override Ability.GetMoveTowardsLocations() when a custom ability needs a prepared pose. Return null or an empty array when no approach is required. Return several components when Move Towards should choose the closest one.
using Opsive.UltimateCharacterController.Character.Abilities;
using Opsive.UltimateCharacterController.Objects.CharacterAssist;
using UnityEngine;
public class UseConsoleAbility : Ability
{
[SerializeField] private GameObject m_Console;
public override MoveTowardsLocation[] GetMoveTowardsLocations()
{
return m_Console != null
? m_Console.GetComponents<MoveTowardsLocation>()
: null;
}
}
MoveTowardsLocation exposes Offset, YawOffset, Size, Distance, Angle, RequireGrounded, PrecisionStart, and MovementMultiplier. Runtime values include TargetPosition, TargetRotation, StartOffset, and StartYawOffset. GetTargetDirection, IsPositionValid, and IsRotationValid expose the same checks used by Move Towards.
MoveTowards exposes StartMoving(MoveTowardsLocation[], Ability), MoveTowardsLocation(Vector3), MoveTowardsLocation(Vector3, Quaternion), StartLocation, OnArriveAbility, and its Inspector settings. UltimateCharacterLocomotion.MoveTowardsAbility returns the controller’s cached Move Towards instance.
The position-only MoveTowardsLocation(Vector3) overload creates an independent runtime location when needed, sets Offset and Yaw Offset to zero, disables Precision Start, sets Distance to 1, and sets Angle to 360. The position-and-rotation overload uses the same runtime location but keeps its current Angle.
When Disable Gameplay Input is enabled, Move Towards sends OnEnableGameplayInput with false on start and true on stop. It sends OnCharacterForceIndependentLook with true while it owns final facing and false on stop. It also listens to OnCharacterAbilityActive so an active Speed Change multiplier contributes to its generated input.
In multiplayer builds, StartMoving rejects a non-authoritative, non-local character. Destination selection and the waiting-ability handoff therefore begin on the character owner or authority path rather than independently on every observer.