Create one small formation on open navigation data before adding dynamic spawning, combat, or narrow level geometry. The formation task chooses slots; the selected pathfinder still owns routes, avoidance, and movement.

The default pathfinder uses Unity’s navigation mesh. Supported integrations can provide another pathfinder without changing the group workflow.

Create a formation

  1. Use the same pathfinder implementation on every formation member.
  2. Run the same Formations Pack pattern on each participating behavior tree.
  3. Give every member of one formation the same Formation Group ID.
  4. Set Force Leader on one member when leadership must be deterministic. Otherwise, the first registered member becomes the leader.
  5. Set the leader’s Target Position and Formation Direction.
  6. Configure the spacing or shape fields unique to the selected formation.

Enter Play Mode with all members active. The group should assemble, maintain its pattern while moving, and settle at the target without repeatedly swapping positions.

Formation lifecycle

  1. Active tasks register under Formation Group ID during the manager’s registration window.
  2. One member becomes the leader and establishes the formation center and direction.
  3. The selected pattern calculates one ideal position per registered member.
  4. Slot assignment maps members to those positions and the pathfinder begins movement.
  5. Out-of-range and stuck rules control catch-up and failure behavior while the formation updates.
  6. Removal settings decide whether a departed member fails the task or causes the remaining slots to be recalculated.

Diagnose the stages separately. Missing members indicate registration or group data; overlapping target markers indicate shape or spacing; valid markers with poor routes indicate navigation or avoidance.

Registration delay

FormationsManager waits briefly before starting a formation so every active member has time to register. A formation task adds the singleton automatically when none exists. Add FormationsManager to the scene yourself when you need to configure this start delay explicitly.

If a group begins with missing members, increase the delay or ensure all agents are enabled before their formation tasks start. The delay is a collection window, not a remedy for trees that never reach the task.

For spawned groups, start the formation after the expected members exist or use a delay long enough for their normal enable sequence. Avoid an excessive value that makes every correctly prepared group appear unresponsive.

Next steps