Formation Controller
The Formation Controller is the central brain of the system. It's a singleton component responsible for processing all player input, managing selections, and issuing commands to the Formation components in the scene. To use it, simply drag the Formation Controller Prefab into your scene. It can be found under Assets\TopsonGames\Large Scale Formation System/Prefabs/Indicators and Waypoint. If you just wish to setup a quick scene without looking to deep inside the scene you just need to setup the Ground Mask and Unit Mask (down below) aswell as baking the Navmesh.
Input Actions
This system utilizes Unity's modern Input System. It is recommended to use the default input bindings provided with the package to ensure optimal functionality. The following controls are available:
Left Mouse Click (Select Action): Selects a single formation.
Shift + Left Mouse Click (Multi Select Action): Adds formations to the current selection or removes them with each click.
Left Mouse Drag (Select Action): Draws a selection box to select multiple formations.
Right Mouse Click (Move Action): Sets the movement waypoint for the selected formation(s).
Right Mouse Drag (Move Action): Adjusts the width of a single formation or scales multiple formations simultaneously.
Spacebar (Show Waypoint Action): Reveals all movement paths to their destination positions.
Mouse Hover (Mouse Position Action): Highlights formations under the cursor.
Input can be customized at the InputSystem actions which can be found at Assets\TopsonGames\Large Scale Formation System/Input System/Input System Actions Here you can assign new Inputs.
Assign Ground Mask
The physics layer your walkable ground is on. This is crucial for the controller to know where to place movement waypoints.
Assign Unit Mask
The physics layer your units are on. This is the Layer previously set in the "Create Unit" section. Without it being the same Layer as the Unit no selection is possible. Please note that the Ground and Unit mask cannot be the same, otherwise deselecting the Unit with left click will not be possible.
Team ID:
Determines which formations this controller can select and command. Set this to 0 to control all formations with the TeamID set to 0.
Ui Feedback
These settings control the visual aids that help the player.
Show Indicator On Hover: If checked, selection indicators will appear on a formation when you mouse over it. This provides immediate feedback on what you are about to select.
Show Enemy Indicator: If checked, hover indicators will also appear on enemy formations (those with a diAerent Team ID).
Hover Hide Delay: A short delay in seconds before a hover indicator fades out after the mouse leaves. This prevents flickering.
Show Path To Waypoint: If checked, holding the Show Waypoints Action key will also draw the LineRenderer path for each formation.
Selection Box Texture: The texture used to draw the selection box when you left click and drag. If left empty, a default semi-transparent box will be used.
Formation Drag Settings
These settings control how a single formation behaves when you right-click and drag to reshape it.
Min Formation Width: The minimum number of units in a row the formation can have.
Allow Single Row Formations: If checked, you can drag a formation out into one long line of units. If unchecked, the maximum width will be one less than the total number of units, forcing at least two rows for larger groups.
Max Single Formation World Width: The maximum length in world units that you can drag a single formation's new shape. Please note that this gets also used to calculate the maximum width for multi formations
Spacing Between Formations: The gap in world units that is placed between different formations when you are dragging a group of them together.
Multi Formation Drag
This applies when you have more than one formation selected and you right-click and drag.
Min Group Scale: The minimum scale factor applied to a group of formations when dragging. This prevents formations from shrinking to an unreadably small size if you drag over a very short distance.
Now the only thing left is baking the NavMesh
Last updated