Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/habrador/unity-select-units-within-rectangle-tutorial

Unity tutorial on how to select units within rectangle
https://github.com/habrador/unity-select-units-within-rectangle-tutorial

gamedev opensource unity unity-tutorial unity3d

Last synced: about 1 month ago
JSON representation

Unity tutorial on how to select units within rectangle

Awesome Lists containing this project

README

        

# Select units within rectangle

Source code for Unity tutorial on how to select units within rectangle. Notice that the code is not exactly as in the tutorial because I've learned one or two things but the idea is the same. The main difference you should change is that border of the selection square has to be 2 pixels wide, or you will see some flickering.

![Closest point on line segment](/_media/select-units-within-square.png?raw=true)

YouTube video showing the result:

[![Select units in Unity video](http://img.youtube.com/vi/DXsF87vbwYU/0.jpg)](http://www.youtube.com/watch?v=DXsF87vbwYU "Select units in Unity video")

Link to the tutorial: https://www.habrador.com/tutorials/select-units-within-rectangle/

If you also want to highlight the units you selected with some rectangle around it, the idea is basically the same. This is a good tutorial on the topic: https://www.youtube.com/watch?v=2Tgqr1_ajqE