Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


Sorting Group component reference

Explore the properties you can use to determine the rendering order of a group of 2D GameObjects.
Read time 1 minuteLast updated 12 days ago

Explore the properties you can use to determine the rendering order of a group of 2D GameObjects. For more information, refer to Prevent 2D GameObjects mixing in sorting layers.

Property

Description

Sorting LayerSets the sorting layer of the sorting group. All the child GameObjects render on this sorting layer, but keep their order. Unity renders sorting layers in the order of the list in the Tags and layers window.

Select Add Sorting Layer to create a new sorting layer.
Order in LayerSets the sublayer of the sorting group within the Sorting Layer. All the child GameObjects render on this sublayer, but keep their order. Unity renders lower values before higher values.
Sorting TypeSets where Unity places the group while sorting. The options are:
  • Default: Unity sorts this group with other groups at the same level in the hierarchy.
  • Sort at Root: Unity sorts this group at the top level of the hierarchy, and ignores the parent sorting group.
  • Sort 3D as 2D: Unity sorts this group at the top level of the hierarchy, and ignores the z value of 3D GameObjects in the group so they're sorted as 2D.

Additional resources