# Add unit placement to scene

This package supports Unity's both new `InputSystem` and the old `Input` for player controls.&#x20;

**Steps to setup:**

1. Drag & drop prefab <mark style="color:green;">**FormationPlacement**</mark> into your scene.
2. Configure <mark style="color:blue;">**FormationPlacement**</mark> component:
   1. **Input section**, by default all layers are selectable for raycasts.
   2. **Visual section**, by default formation will be calculated and visible during active placement.
3. Configure <mark style="color:blue;">**UnitFormation**</mark> component:
   1. Place units on ground or use their absolute formation position for target.
   2. Add noise to units final target positions.
   3. Connect desired units on existing <mark style="color:blue;">**UnitFormation**</mark> component
4. Save Scene.

<figure><img src="https://373113018-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FO5oY9g3h48cclwOChrGD%2Fuploads%2FH5bskHWBzBCHgtFJL8H7%2Fimage.png?alt=media&#x26;token=e2eac49b-9e03-4b58-b36b-a2048bbc24fd" alt="" width="563"><figcaption><p>Formation Placement &#x26; Unit Formation component configurations</p></figcaption></figure>

#### Customisation

Instead of using existing <mark style="color:blue;">**UnitFormation**</mark>**&#x20;component**, you can add multiple components for each of your unit groups (if units are always grouped) and reference it to the <mark style="color:blue;">**FormationPlacement**</mark> component in Editor or during Runtime if focused formation has changed.

```csharp
// Set new unit formation at any time
FindObjectOfType<UnitPlacement>().SetUnitFormation(newUnitFormation);
```

Ok, You are now **done** with scene set up!&#x20;
