x


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!

more ▼

asked Apr 12 '12 at 12:57 PM

@rppe gravatar image

@rppe
20 4 7 10

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

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.

more ▼

answered Apr 12 '12 at 01:01 PM

john essy gravatar image

john essy
174 23 41 48

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x983
x225
x155
x90
x31

asked: Apr 12 '12 at 12:57 PM

Seen: 455 times

Last Updated: Apr 12 '12 at 01:01 PM