Version: Unity 6.5 Alpha (6000.5)
Language : English
Set 3D GameObjects to interact with Sprite masks
Get started with 3D game development

Sort 3D GameObjects with 2D sprites

Sort 3D GameObjectsThe fundamental object in Unity scenes, which can represent characters, props, scenery, cameras, waypoints, and more. A GameObject’s functionality is defined by the Components attached to it. More info
See in Glossary
with 2D spritesA 2D graphic objects. If you are used to working in 3D, Sprites are essentially just standard textures but there are special techniques for combining and managing sprite textures for efficiency and convenience during development. More info
See in Glossary
in the same sceneA Scene contains the environments and menus of your game. Think of each unique Scene file as a unique level. In each Scene, you place your environments, obstacles, and decorations, essentially designing and building your game in pieces. More info
See in Glossary
.

When you enable the Sort as 2D property, if 3D meshes have the same depth, Unity renders them like overlapping 2D sprites instead of intersecting meshes.

Follow these steps:

  1. Add a Sorting Group component to the 3D GameObject.
  2. Enable Sort as 2D in the Sorting Group property settings.
  3. Assign Sorting Layers and Order in Layer values to determine the 3D renderer’s position in the render queue.

Important: Enabling the Sort as 2D setting clears the object’s depth information which means you cannot use it with depth-based post-processingA process that improves product visuals by applying filters and effects before the image appears on screen. You can use post-processing effects to simulate physical camera and film properties, for example Bloom and Depth of Field. More info post processing, postprocessing, postprocess
See in Glossary
effects. If you want to use these kind of effects, use Unity’s default behavior that renders sprites and meshes based on their world-space depth.

Additional resources

Set 3D GameObjects to interact with Sprite masks
Get started with 3D game development