You've successfully subscribed to Hacking with Unity - Learn how to create your own games
Great! Next, complete checkout for full access to Hacking with Unity - Learn how to create your own games
Welcome back! You've successfully signed in.
Success! Your account is fully activated, you now have access to all content.
Success! Your billing info is updated.
Billing info update failed.

Coordinate system in Unity

Ben Liu
Ben Liu

Unity uses several different coordinate systems at the same time, as follows:

Screen Space

Also named Screen point system. The screen coordinates are defined in pixels. The lower left corner of the screen is the start (0, 0) point, and the upper right corner is the (Screen.width, Screen.height) point. As shown below:

This Coordinate system is used in the game play. When mouse click or finger tap, Unity will give out this kind of coordinate in the format of (x, y). So we have to use the method ScreenToWorldPoint to convert to  World Space system.

GUI Space

When drawing GUI on the screen, such as popup dialog window. Unity will use a new coordinate system. The difference is that the coordinate system uses the upper left corner of the screen as (0, 0) point and the lower right corner as (Screen.width, Screen.height).

World Space

Also named World point system. This the main system used in the game. When adding game objects (such as Cube) to the scene/hierarchy, and they are all displayed in the scene in world coordinates.We can get a game object's position by calling gameObject.transform.position.

View Port Space

The viewport coordinates are relative to the camera. The lower left corner of the camera is the (0, 0) point, and the upper right corner is the (1, 1) point. The position of Z is measured in the world unit of the camera.

About World space and Local space - Unity Answers
Unity is the ultimate game development platform. Use Unity to build high-quality 3D and 2D games, deploy them across mobile, desktop, VR/AR, consoles or the Web, and connect with loyal and enthusiastic players and customers.

Ben Liu

Please feel free to contact me if you have any question. <br> https://t.me/NeedoneApp