---
description: Quick guide to set up your units for selection.
---

# Add selection to units

**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&#x26;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](add-selection-to-scene "mention").
4. Save unit prefab.



To find out more about specific selectable component check out [selectable-unit](../how-it-works/selectable-unit "mention") and [selectable-group-unit](../how-it-works/selectable-group-unit "mention") 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.**
