Working in 2D

To begin, let’s make sure we are working in the correct workspace. By default, Unity is a 3D game engine. This means it works in 3D space with an X-axis (left to right), Y-axis (up and down), and then an additional Z-axis (front to back).

Since our game is a traditional 2D side scroller, we will not need a true Z-axis plane, but we still require a Z-depth. Z-depth refers to elements that appear to be at different depths and sizes. Using this will make our game appear not to have everything on the same focal plane and will allow us to fake the third dimension of objects in front of and behind one another. There are a couple of ways to have our GameObjects appear to be in front of and behind one another, but first let’s look at a ...

Get Learning 2D Game Development with Unity®: A Hands-On Guide to Game Creation 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.