Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Sorting Layers in Unity2d

    • 0
    • 1
    • 1
    • 1
    • 0
    • 0
    • 2
    • 0
    • 1.05k
    Comment on it

    When building a 2D game in Unity3D. We need to specify which items will be rendered above which item.

    We can do it by specifying the distance of the sprite from the camera but Unity provides a better way of doing this through the use of Sorting Layers.

    Sorting Layers are used to determne the rendering order of the sprites regardless of the distance from the camera.
    We can assign a sprite or a group of sprites to a sorting layer. These Sorting Layers are given a sorting order. When we render a sprite we can also secify it's order within a sorting layer.

    Sorting Layers Can be Found in the Edit Menu -> Project Settings -> Tags and Layers OR From Sprite component Select -> Sorting Layer -> Add Sorting Layer


    alt text


    After the sorting layer panel is open, we can Add, Delete and Re-arrange sorting layers. There is a default layer that cannot be remover but it can be rearranged.

    We can assign a sorting layer to a sprite through it's drag and drop Layer menu as shown below.


    alt text


    Sorting Layers are rendered in the order of top to bottom in the sorting layer list. The first item is drawn in the back while the last item at the top. It is to be noted that Sorting Layers and Order in layer are Globally available to all renderers in Unity

    Sorting Layers in Unity2d

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: