> For the complete documentation index, see [llms.txt](https://travljen.gitbook.io/unit-selection/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://travljen.gitbook.io/unit-selection/getting-started/add-selection-to-units.md).

# Add selection to units

Quick guide to set up your units for selection.

**Video:** You can also see the quick set up video [here](https://www.youtube.com/watch?v=bI2_SdG-qS8).

This package supports out of the box selection support for units. Follow the steps below to set up your game object for selection.

**Steps to set up:**

1. Add <mark style="color:blue;">**SelectableUnit**</mark> component on any of your game objects (ideally prefabs). This adds core functionality and supports **Click** and **Hover** for objects, but not drag selection and few others like managed filtering. **Groups:** For selecting groups or squads of units, use <mark style="color:blue;">**SelectableGroupUnit**</mark> component for each single unit itself and then on your group controller add <mark style="color:blue;">**SelectableGroup**</mark> component.

<figure><img src="https://425343605-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fml7vS0D5xN2Q8jQMEmBv%2Fuploads%2F1KAJLxeVpX2EUVkwOBc8%2Fimage.png?alt=media&amp;token=d002f94f-4639-46f0-be2b-c5e5c2f1130f" alt="" width="404"><figcaption><p>SelectableUnit component</p></figcaption></figure>

1. If you wish to use **Drag** selection feature and all others, you should also click the **Enable drag selection** button on this component or manually add <mark style="color:blue;">**ManageUnitObject**</mark> component.&#x20;
2. Make sure the game object with component has a <mark style="color:blue;">**Collider**</mark> of any type.&#x20;

   *This is important for **hover** and **mouse** click, as well as mouse **drag** with collision detection types. Without colliders collision detection or raycasts cannot be used.*
3. Set **Layer** of the game object to selectable layer you have added or used for selection system, described here: [Add selection to scene](/unit-selection/getting-started/add-selection-to-scene.md).
4. Save unit prefab.

To find out more about specific selectable component check out [Selectable Unit](/unit-selection/how-it-works/selectable-unit.md) and [Selectable Group Unit](/unit-selection/how-it-works/selectable-group-unit.md) pages.

And that is it! With collider, layer and <mark style="color:blue;">**SelectableUnit**</mark> component you should be able to select game objects. **Next step, add visuals to see selection in action.**
