Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
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!
–
–
–
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:
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)
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.
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.
According to this (
Unity 2D vs 3D
),
Unity 2D is always faster than 3D
. I know the comparison is for Unity 4.3 but it is probably still relevant for Unity 5.
The above comparison is not an official benchmark done by Unity, so take it with a grain of salt? Probably the best way to be sure is to do the benchmark oneself...
Here is an excerpt from the blog:
So if you are developing 2D games today, there is no excuse for starting to use the new Physics engine. You’ll get better performance, meaning you’ll have more CPU time at your disposal to create even better games.
It is their word, not mine though.
Thanks for contributing an answer to Stack Overflow!
-
Please be sure to
answer the question
. Provide details and share your research!
But
avoid
…
-
Asking for help, clarification, or responding to other answers.
-
Making statements based on opinion; back them up with references or personal experience.
To learn more, see our
tips on writing great answers
.