Unit Selection
  • Welcome
    • πŸ‘‹Hello
    • πŸ—ΊοΈRoadmap
    • ⛑️Support & Community
    • πŸŽ“Changelog
  • Getting started
    • πŸ”ŒImport package
    • πŸ› οΈAdd selection to scene
    • 🦲Add selection to units
    • β›³Add visuals to units
  • How it works
    • 🎯Active Selections
    • 🫡Unit Selector
    • πŸ”’Quick Access Selector
    • ⬛Selection Area
      • πŸ”²2D Rectangle
      • 🧊3D Cube
    • πŸ’ Selectable Unit
      • πŸ“Selection Bounds
      • β­•Selection Indicator
    • Selectable Group Unit
    • ⌨️Input Controls
    • πŸ‘·β€β™€οΈUnit Management
Powered by GitBook
On this page
  1. Getting started

Add selection to units

Quick guide to set up your units for selection.

PreviousAdd selection to sceneNextAdd visuals to units

Last updated 7 months ago

Video: You can also see the quick set up video .

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 SelectableUnit 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 SelectableGroupUnit component for each single unit itself and then on your group controller add SelectableGroup component.

  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 ManageUnitObject component.

  2. Make sure the game object with component has a Collider of any type.

    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.

  4. Save unit prefab.

To find out more about specific selectable component check out Selectable Unit and Selectable Group Unit pages.

And that is it! With collider, layer and SelectableUnit component you should be able to select game objects. Next step, add visuals to see selection in action.

🦲
here
SelectableUnit component