While developing Error Hunter in Unity, I found out there were 3 ways to display a point on screen:
….and then we have the World Point. It seems to have it’s own unique measurement. eg. when you use transform.position += transform.right; you move the object to the right by 1 amount of this special measurement. Also, I couldn’t find a way to get the screen width/height in this ‘world space’. Quite a headache.
So, world points suck and you shouldn’t use them right? Wrong! You can only move objects around in world space so everything has to be converted to that. Here’s what I did in Error Hunter:
Vector3 fullScreen = Camera.main.ScreenToWorldPoint(new Vector3(Screen.width,Screen.height,10));
I made a screen point in the top right and then converted it into world point. This allows me to use things like
if (aRect.transform.position.y>fullScreen.y) {}
to check if something is going off screen.
Thank you. Glad I found this. This really helped me! Was clear and simple to help me understand Unity’s many systems of measurements.
This was a clear explanation.
A little drawing is better than a long discourse.
Thank you.