Layers in 2d. Dont understanding :(

Hi guys!

I tried a create my first very simple game, but i have a some small issue and i cant understand how to resolve it :frowning:

  1. I have a sprite with sprite
    child. Both generates randomly from
    array

  2. Sprite parent have ā€œorder
    in Layers 1ā€, sprite child - ā€œorder
    in layers 2ā€

  3. When he moving and
    imposition with another one, sprite
    childs in upper on both spritesā€¦

How i can to resolve it? I think it will be very easy but iā€™m stuckā€¦

Since I donā€™t know what these objects are I canā€™t name these as I should but what I would do for you is Sorting Layers

Create 2 sorting layers

  1. ObjectA
  2. ObjectB

Assign 1 parent and itā€™s child to each layer
make sure the order in layer is to 1 on that child

position the layers accordingly

More information here :slight_smile: - Unity for 2D: New Workflows in Unity 4.3 - Unity Learn