Unity 2D vs 3D differences

Vali Rosca picture Vali Rosca · Jun 15, 2014 · Viewed 16k times · Source

What are the main differences between Unity 2D project and unity 3D project! Does unity render faster 2D projects than 3D? Or does 2D prefabs/textures require less memory than 3D? Is there an option for creating 2D meshes in 2D projects?

Thank you for your time!

Answer

sonofrage picture sonofrage · Jun 30, 2015

The difference really lies in what kinds of objects you use in your scene and what camera you use. You can mix both 2D and 3D stuff in the same scene. Let me try to enumerate the differences when working with 2D and 3D:

  1. Camera: To get a 2D view of your world, you use an orthographic camera. With such camera you won't see the "perspective effect" of objects tapering away as they go farther away from the camera. A cube viewed from one side with an orthographic camera will be a square. The orthographic camera doesn't care about the distance of objects from the camera (as long as they are within the clipping plane of the camera)
  2. Sprites vs Meshes: You would generally use 2D sprites in a 2D game, attached to an object using the SpriteRenderer component. But you can also display 2D objects using textured quadrilaterals. In a 3D game, you would instead use the MeshRenderer component to display 3D meshes. You can, however, mix both kinds of contents in the same scene and achieve for example, a 2.5D effect.
  3. Physics2D vs Physics: Unity has two sets of physics tools: one for 3D and one for 2D. On a 2D game, it's easier to use the 2D physics tools: (RigidBody2D, Collider2D, related classes for scripting). For 3D games, you would use the 3D physics tools (RigidBody, Collider, and corresponding script classes). Note that you cannot mix 2D physics with regular physics, i.e., you cannot make a ball with CircleCollider2D bounce off of a box with BoxCollider.

Does unity render faster 2D projects than 3D?

Generally, yes, each 2D sprite can be thought of as a very simple flat 3D object (a textured quadrilateral with two triangles). It would render faster than a 3D character with thousands of triangles.

Is there an option for creating 2D meshes in 2D projects?

Sprites are what you would generally use for 2D; they are just rectangular pictures. A mesh is a 3D construct. You can import a flat mesh and orient it properly in a scene to make it look 2D.