- Home /
Selection and Deselection
I am working on a Real Time Strategy game and so far its taking shape a bit like Age of Empires, though thats not what I am after. What I am after for selection though is the same. I have basic selection through the use of function OnMouseDown()
but I want to be able to deselect the units afterword. Also, I can figure this out after but if you could help, how do you select with a selection box, and with Shift + LeftClick to add to large selections? Any Help would be GREATLY appreciated!!! Thanks!
Answer by john-essy · Apr 12, 2012 at 01:01 PM
Well i have an answer for your deselecting. What you could do is cast a ray from your cameras centre and if it hits anything that is not tagged as say PlayerUnits(This would be units and buildings) then deselect the units. I dont know how you have this set up so i dont want to give you an example incase it is way off the mark, I hope this helps you mate and good luck.
Your answer
Follow this Question
Related Questions
Unity doesn't recognize mouse clicks, C# 1 Answer
Examples of TBS/Heavily Gui-driven Games in Unity? 2 Answers
How to change selected button in EventSystem or deselect it 5 Answers
Click Sound 1 Answer
Change Camera on (Right) Mouse Click 1 Answer