- Home /
Question by
NDPW · Mar 15, 2015 at 03:46 PM ·
convertscreentoworldpointwidth
convert screenwidth to ScreenToWorldPoint
Hello, I am working on a script and I basically made everything in the game screen to world. But now I want to calculate the screen width so I can make multiplayer controls. How do I get the screen width that has a value I can use with the rest of my scripts. To clear things up, here is what I am trying to do:
if (pos.x > (Screen.width/2)){
}
(pos.x is converted to a ScreenToWorldPoint.)
Comment
I feel like pos should work if you use the correct camerea, i.e. camera1.ScreenToWorldPoint(pos) vs camera2.ScreenToWorldPoint(pos).
Perspective or Orthographic camera ? If it's orthographic, i think ou would've found the answer pretty quickly with search. For example here
Your answer
![](https://koobas.hobune.stream/wayback/20220613190220im_/https://answers.unity.com/themes/thub/images/avi.jpg)