Skip to content


Folders and files

Last commit message
Last commit date

Latest commit



12 Commits

Repository files navigation

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

YouTube video showing the result:

Select units in Unity video

Link to the tutorial:

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: