- Home /
How can I select multiple units in 3D by lasso selection / drag and select ?
I found a very good tutorial that does almost everything I need here : https://sharpcoderblog.com/blog/unity-3d-rts-style-unit-selection with a drag and select / lasso selection.
However, the issue I have with it is that I only reacts to the transform.position of the selected building / unit. This means that selecting a single unit by a single click is not possible but it also means that when trying to select multiple units, unless you get the transform.position, the unit will not be selected.
My question : How can I create a temporary volume from the camera clippings + user selection to check if I have an intersection with the Bounds of the unit or a collision with the collider of the unit ?
I do not know if there is a better answer, I tried looking into existing games and noticed that they used a very simple collider ( usually a cube or a capsule ). This allows to do single unit / multiple units selection easily and the player will usually not notice the trick.