Version: Unity 6.7 Alpha (6000.7)
Language : English
Prevent 2D GameObjects mixing in sorting layers
Scaling sprites dynamically using 9-slicing

Sorting Group component reference

Explore the properties you can use to determine the rendering order of a group of 2D 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
. For more information, refer to Prevent 2D GameObjects mixing in sorting layers.

Property Description
Sorting Layer Sets 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 Layer Sets 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 Type Sets 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

Prevent 2D GameObjects mixing in sorting layers
Scaling sprites dynamically using 9-slicing
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961