Create the first group on open navigation data with a stationary or slowly moving leader. The built-in tasks use Unity’s navigation mesh; integrations add variants for other supported pathfinders.

Create a formation

  1. Use the same pathfinder implementation on every member.
  2. Run the same formation pattern on every participating agent’s behavior tree.
  3. Configure the group and target fields so the tasks refer to the same formation.
  4. Start all participating trees and verify that one member becomes the leader.
  5. Tune spacing and movement for the navigation agent radius and level geometry.

In Play Mode, the group should assemble and preserve its shape while traveling. Disable or remove one member to verify remaining assignments update correctly.

Try three Line members

Use three agents on the same baked, open NavMesh. Each agent has one NavMeshAgent and a tree with Entry → Line. Start the members already aligned, with the blue leader and two cyan members separated by two units.

Entry connects directly to the classic Formations Pack Line task.

On the leader, leave Leader unassigned. On each follower, assign the leader GameObject to Leader. Set Target Transform to the same stationary Goal, use Wait Time 0.5, set Separation to 2 and leave Right disabled on all three tasks. Place the Goal pivot at the same height as the agents’ pivots; the orange marker can remain on the floor beneath it.

Line leaves Leader unassigned for this leader, targets Goal, waits 0.5 seconds, uses Separation 2 and leaves Right disabled.

The blue leader and two cyan members start aligned to the left of the orange Goal on an open navigation floor.

Start all three trees. The tasks register three members, navigate across the floor, then settle near Goal in a lateral line. All three trees return Success in the result below.

The blue leader reaches the orange Goal with two cyan members aligned beside it after all three Line trees report Success.

This example starts aligned and travels straight to a fixed Goal. Use the checks below when extending it to formation assembly, rotation or changes in membership.

Formation lifecycle

Each member registers with the group used by its task. The group identifies a leader, assigns an index, and calls the selected pattern to determine a world-space target. As the leader moves or turns, those targets update. When membership changes, the formation recalculates.

A mathematically correct slot may still be unreachable near a wall or outside the navigation surface. Diagnose calculation and movement separately.

Diagnose the first failure

  • Missing members indicate a task, registration, or shared-group problem.
  • Overlapping target markers indicate shape, spacing, or custom position math.
  • Valid markers with no motion indicate a pathfinder or movement-authority problem.
  • Correct movement with poor final spacing indicates local avoidance, stopping distance, or route width.

Verify before expanding

Test one, two, and several members; a moving and rotating leader; an incomplete final row; member removal; and a narrow route. Continue with Runtime Control and Tuning only after open-space assembly works.