My computer screen resolution is 1920x1080. So if I use Screen.width, it should return 1920, right?
However, when I enter it into my script, it returns 416 instead. Any one has any idea why this is so?
boxWidth = Screen.width*0.25f, //Width of GUI background box
This is suppose to be the width of my GUI box, but it shows 104 instead of the expected value, 480.
I assume you have set the Unity resolution to 1920x1080? I created a project and tried it out with your code and I get a result of 408.75. If I build the project and run it, I get 480 as a result. Not sure if there is a bug or a way around it but it looks like you'll have to test build fairly often.
– g0tNoodles