Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice

Sprite Rendering Order

Discussion in '2D' started by dmarcosm, Feb 27, 2016.

  1. dmarcosm

    dmarcosm

    Joined:
    Jul 24, 2015
    Posts:
    1
    Hi folks.


    I'm pretty new in Unity, so this maybe are a lame question. I have an gameobject that represents a person. This object has two child sprites that are his head and body respectively. The problem is that Unity are rendering the body over the head and I want the contrary.

    I've tried using layers in the Sprite Renderer component, but when two persons cross each other the head of one are rendered over the body of the other, and I don't want it either.

    How can I do the both sprites of the person gameobject act like one and at the same time make sure the head is going to be rendered over the body?

    Thank you.
     
  2. jc-drile77

    jc-drile77

    Joined:
    Jul 1, 2014
    Posts:
    230
    Sorting layers and order in layers :)
    https://unity3d.com/es/learn/tutorials/modules/beginner/2d/sorting-layers
     
    Last edited: Feb 29, 2016
  3. LiterallyJeff

    LiterallyJeff

    Joined:
    Jan 21, 2015
    Posts:
    2,807
    If you have two identical person objects overlapping, what determines which one will be on top? That determination will be how you should set up your layers.