- Home /
Box Selection
Hey,
What I am trying to do is create a strategic type selection function. Now using GUI box to create a 2D box on screen and finding the start and end point using ScreenToWorldPosition and finding all objects in between has done the trick.
But finding all game objects between two points generates one problem. Due to the slanted camera the box created on the ground is not exactly the box shown on the screen.
The box generated on the terrain looks more like the one on the left and the box on the screen looks like the one on the right.
.________ . __________
/ \ | |
/ \ | |
/ \ | |
/______________.\ |__________.|
The dots represent the start and end points of when the mouse is clicked.
Therefore some objects in the top right corner are not selected and some objects in the bottom left corner are unintentionally selected.
Now I tried calculating the acute angle of this polygon but wasn't successful.
How would i go about implementing the exact box position on the screen onto the terrain?
Your answer
Follow this Question
Related Questions
Arial camera get selected point 2 Answers
How to make camera position relative to a specific target. 1 Answer
How can I select, single out and zoom into my object? 2 Answers
Diagonal camera limit 0 Answers