Use Move To Cover to find protection, reach it, and validate the actor’s actual arrival. It is the pack’s cover Action. Its Result, selected-cover outputs, and diagnostics let the surrounding state machine decide whether to maintain protection, engage, or recover.

Set up a cover state

  1. Give the actor a working Movement Agent and provider. Test Seek before configuring cover.
  2. Add Move To Cover to an Action State and bind Result to a movement-result variable.
  3. Choose Threat Mode: Target, assign Threat, and set Threat Offset to the threat’s local eye position.
  4. Set Cover Layers to protective geometry. Set Occupancy Layers to other actors or objects that should prevent selection of an occupied position.
  5. Set Cover Height, Cover Radius, and Cover Offset to fit the actor at a foot-level origin. Set Search Radius to bound the search around the actor.
  6. Bind Has Cover, Cover Position, Cover Normal, Cover Object, Required Stance, and Cover Failure when later states need them.
  7. Choose Completion Mode: Arrival to finish after stable concealed arrival, or Maintain to stay in cover and recover when it becomes invalid.

Candidates are checked after navigation sampling for physical clearance, center-and-shoulder concealment, occupancy, and a complete route. A point behind a wall is not usable if the agent cannot reach it or fit there.

Choose the threat input

Threat Mode Input and behavior
Target A GameObject plus a local eye offset. A missing target fails. Motion and replacement of the target variable are read while the Action runs.
Position A world-space eye position, useful for a remembered threat.
Direction A horizontal world-space direction pointing toward the threat. A zero direction is invalid.
Agent Forward Captures the actor’s initial forward direction. Turning later does not rotate the threat.
Automatic Uses a supplied target at startup; otherwise captures the actor’s initial forward direction.

The default is Target. The query evaluates one threat at a time. Multiple-threat tactics and peeking or attack decisions belong to the surrounding state machine.

Stance and actor dimensions

Stance Mode allows Standing, Crouching, or Either. Either evaluates both heights and prefers standing when the same point has equal cost. Read Required Stance and apply it through the character controller or animation system; the Action does not change controller height or animation automatically.

Cover Height measures height above the actor’s feet and Cover Radius is body half-width. Crouch Height supplies the reduced height. Infer Dimensions reads a Character Controller, vertical Capsule Collider, or NavMesh Agent, in that order, accounting for collider scale. If crouching changes the controller’s size, explicit standing dimensions keep the standing reference stable.

Dimension inference does not move a centered pivot to the feet. Supply an appropriate actor origin or integration. Selecting a crouching stance also does not make a standing navigation agent fit through a crouch-only passage.

Geometry and authored Cover Points

Cover Source selects Geometry, Authored Points, or Both. For an authored point, add Cover Point to a foot-level transform, face its forward direction along the outward cover normal, and assign its physical Cover collider, allowed Stances, and optional Priority.

Authored points still pass all safety, layer, navigation, occupancy, and reservation checks. Disabled points are excluded and moved points are queried again. Selected Cover Point identifies an authored selection and is empty for geometry-generated cover.

Selection scores only valid candidates:

Preference Lower cost wins
Shortest Path Complete route length.
Threat Distance Route length minus distance from a positional threat multiplied by Threat Distance Weight.
Authored Priority Route length minus authored priority multiplied by Priority Weight. Geometry candidates have priority zero.

Minimum Threat Distance is a hard restriction for positional threats. Directional threats have no meaningful distance, so distance scoring uses route length instead.

Maintenance, recovery, and work limits

Recheck Interval controls repeated concealment and occupancy validation while moving or maintaining cover. Actual arrival is always validated. Stable Arrival Duration requires uninterrupted valid arrival before success.

In Maintain, Reselection Interval controls optional searches for better cover; zero disables them. Minimum Improvement prevents replacing still-valid cover for a negligible score change. Invalid cover can trigger recovery regardless of this threshold.

Maximum Retries bounds consecutive recovery searches and Retry Delay spaces them. Zero retries ends after the initial failed search. Sustained valid arrival resets recovery attempts. A timeout remains terminal. Cover Failure retains the underlying reason, such as exposure, obstruction, occupancy, unreachable geometry, reservation, or proximity to the threat.

Candidates Per Update spreads candidate/stance validation across Action updates. Maximum Cover Candidates bounds geometry and authored-point collection separately; Maximum Occupancy Results bounds overlap buffers. These are work limits, not a guaranteed millisecond budget. Narrow layers when a search contains too much unrelated geometry.

Reservations and output lifetime

Enable Use Reservations when actors should avoid selecting the same authored point or overlapping cover position. A selection is claimed again immediately before commitment, preventing two searches from committing the same lease. Reservation Duration is renewed while a cover Action runs.

A successful arrival retains the lease briefly for handoff. A normal Seek does not renew it. Failed selection, cancellation, disable, or destruction releases the claim or lets it expire. During a state-machine pause the lease is not renewed, so resume must reacquire or recover. Leases use scaled time. Behavior Designer and State Designer cover reservations are separate; coordinating a mixed-product crowd needs a shared application-level policy.

Successful selection outputs remain after arrival. Restart, failed selection, movement failure, or cancellation clears them. Stored outputs describe the last successful selection and do not guarantee continued safety once the Action has ended. Use Maintain while ongoing protection must be revalidated, or implement the needed live concealment check in the application.

Debug the query

Enable Debug Cover, select the actor, and enable Scene-view gizmos. Red candidates show rejection reasons, yellow candidates passed validation, and green shows the selected point, surface normal, clearance bounds, and threat sight lines. Cyan shows the active NavMesh route. A saturated-budget label means the search limits were reached; narrow the layers or increase the appropriate limit.

Numbered callouts identify the controlled actor, chosen cover position, cyan navigation route, and an Exposed candidate rejected by the real cover query.

1 marks the controlled actor. 2 marks the chosen position and its green standing-clearance bounds. 3 follows the cyan route to that position. 4 marks a rejected Exposed candidate. Green sight lines show the threat’s relationship to the selected body position.

This uses the released demo’s Move To Cover scenario with Debug Cover enabled, Search Radius: 15, and the floor excluded from Cover Layers to focus on nearby protective geometry. The actor is held still for inspection. Read the rejection labels and the selected point together: concealment, body clearance, and a reachable route must all pass for a candidate to be usable.

If no cover is chosen, inspect Cover Failure before increasing search radius. A wider search cannot fix an invalid threat, incorrect layer mask, insufficient clearance, or an unreachable route.