Hello, so I will show the code here then explain what I’m trying to do.
Code
void MouseBoxCheck1(){
if (Input.mousePresent) {
if (Input.mousePosition.x > 634/* Left */) {
if (Input.mousePosition.x < 804/* Right */) {
if (Input.mousePosition.y < 470/* Top */) {
if (Input.mousePosition.y > 402/* Bottom */){
//Doing Stuff here
}
}
}
}
}
}
Right now you have seen what I am doing you can probably tell I’m trying to check if the mouse is in a certain area and if so it does something, however there is a problem with this, as you may be aware the mouse’s coordinates change according to the size of the display area (I found this out when it worked in the editor but not the built application).
What I wish to do is use the world coordinates instead of the mouse ones so that I can use it on any size of display area, so if anyone can offer any advice that would be great. (If you can give examples relative to my code with any answers that would be great, thanks in advance!)