Difference between world coordinates and local coordinates
Every game object in Unity has a position, but a position needs a reference frame (more about reference frames later in Chapter 5, The Secret Ingredient Is a Dash of Physics). In particular, Unity offers two ways to see (and set) coordinates:
- World coordinates: These are absolute coordinates of where the game object is located (by absolute, I mean with respect to the world frame, which is considered to be absolute in the game)
- Local coordinates: These are the coordinates of where the game object is with respect to its parent
You can easily switch between the two coordinates with a toggle in the upper-right part of the Unity interface, as shown in the following screenshot:
As shown in the preceding ...
Get Getting Started with Unity 5.x 2D Game Development now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.