I am unsure on the topic so I figured I should ask the helpful folk at Unity Answers. What I want to do is make an if statement which asks whether the mouse position is in a certain area of the screen.
I am completely unsure on how to do this So I have
Which defines where my mouse is and
which defines where the screen centre is. So what I want to do if possible is an iff statement asking whether the mousePlacement is in a certain area of the screen. Im unsure how to do this or if it is possible. For instance is the mouse somewhere in the left centre, the top left, the bottom left, middle top, middle centre, middle bottom, right top, right middle, right bottom. If you get me :/
Help is much appreciated.
Thank you for your time as always :)
I did what you put and got errors so I edited it to my code and it worked. But the only area I could get going was the one that you put down angle > 0 && angle < 90 im debugging it by print messages is there anyway you could define which angles of the screen are which parts. Notice that I changed it away from using the x axis as my screen look down to x and z.
This time Haha comes up but not lol.
Well, already with what you have you can do a pretty good job of it!
First off, subtract the middle of the screen from the mouse position to get an 'offset' value.
Now, you can translate this offset into polar coordinates, to get an angle and a radius-
Now that you have the angle, you can use that to determine what quadrant the mouse is in!