Coordinate system in Unity

· 2 min read

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.