Drag box selection in 3d space / Building zones / number of objects in the zone

So I want to do something like the selection in this game at 0:18 http://www.youtube.com/watch?v=bBGX0dl5Ziw , could someone give me any tips on how to do it?

As far as I understand, he uses the selection box to build a zone(woodcutting area. For example a zone made of 24x24 tiles that cost an x amount of resources or whatever) on the ground and then checks how many Y objects (in this case, trees) are inside the zone, right? Or am I wrong?

Also, the thing that I noticed from most examples is that the drag selection is being drawn on the screen(2d), rather than being drawn on the game surface(3d), like it is in the example video. This is why i’m asking for help, since I tried doing a drag selection from examples, but i’m getting problems with the 2d box on-screen…thing.

Could someone help me with the following

  1. Drag box selection on the terrain/surface (this is something I can’t understand. Would really need example code or basic examples. Or just someone to point me to the scripting reference and the combination of codes I should read up on to accomplish this)
  2. Creating the zone as big as the selection (I have a few ideas on how I could do it. Code isn’t necessary, just a few tips on how to do this more efficiently)
  3. Checking how many Y objects are in the newly created zone and displaying them on an onscreen GUI (Got the gui, not sure how to find the objects. Besides that, this portion is easy and I think I found an example for this just now.)

I’m working in C# here.

I’m still quite new to c#, so i’m sorry if what i’m asking for is self explanatory.
Thank you in advance for any tips/examples and help!

Haha wow, nevermind. understood it all. I was off by a mile.

What was it? I just looked at the video and it’s hard to tell if he’s using the GUI or actually doing it in 3d space. I’m curious to know as well :slight_smile: