Documentation

Unity Spark

Open Unity Spark

Unity Spark

Introduction to 2D games in Unity Spark

Understand the difference between 2D and 3D games, how Unity Spark chooses between them, how the game camera and Scene view work in 2D, the 2D building blocks, and what the assistant can create.
Read time 3 minutesLast updated 3 hours ago

Unity Spark creates 2D games natively, with sprites, tilemaps, and 2D physics. Ask the AI assistant to create one, or set up a scene yourself.
To set up a 2D game step by step, refer to Set up a 2D game.

Choose between 2D and 3D

The difference between a 2D game and a 3D game is the shape of the world and how players view it.

Aspect

2D game

3D game

WorldA flat plane. Objects have a width and a height, and move up, down, left, and right.A space with depth. Objects have a width, a height, and a depth, and move in any direction.
VisualsFlat images (sprites), often drawn by hand or as pixel art.Models with surfaces that light and shadows affect.
CameraFaces the world head-on, so objects keep the same size at any distance.Can move and rotate around the world, so objects appear smaller farther away.
Typical gamesPlatformers, puzzle games, top-down adventures, and card games.Third-person adventures, racing games, and first-person exploration.
Choose 2D for games that play on a single flat screen, or when you have flat art or want to create it. Choose 3D when players need to explore a space, or when you want depth and a changing perspective. Some 2D games use an isometric view, which shows a flat world from an angle so it appears three-dimensional.

2D or 3D choice for a new game

When you mention
2D
in your first message to the assistant, the assistant records the choice and creates the game in 2D from the start. If you don't specify, it might ask
2D or 3D?
first. Without a recorded choice, it creates the game in 3D. You can also record the choice yourself in the Game Design window.
A new game opens with a 3D starter scene: a character, its camera, touch controls, and a floor. For a 2D game, the assistant removes these starter objects if you haven't changed them. If you changed any of them, the assistant asks before it deletes them.

The game camera and the Scene view

The following settings make a scene 2D, and they're independent of each other:
  • The game camera decides what is visible to players. When its Render Mode is 2D, the camera uses an Orthographic projection, and its Size sets how much of the world fits on screen.
  • The Scene view decides how you view the scene while editing. In the 2D view, the Scene view faces the scene head-on and can't rotate, and objects move only up, down, left, and right. Unity Spark remembers the view for each scene on this device.

2D building blocks

A 2D game in Unity Spark uses the following building blocks:
  • Sprites: Flat images that represent characters, items, and scenery.
  • Tilemaps: Grids you paint tiles onto, which are useful for creating 2D game worlds, platforms, and level layouts.
  • 2D physics: Rigidbody2D and 2D collider components that make objects fall, collide, and detect triggers. 2D physics and 3D physics don't interact.

Ask the assistant to create a 2D game

The assistant creates 2D games with real sprites, tilemaps, and 2D physics. Try the following prompts:
  • Make a 2D platformer with three short levels and a double jump.
  • Slice this sprite sheet and make the player's run animation from it.
  • Find a pixel-art knight on the Asset Store and make it the player.

Additional resources