Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

How to Add 3D Plane Meshes to the 2D Sorting Layer

Discussion in '2D' started by Ben-BearFish, Nov 20, 2013.

  1. Ben-BearFish

    Ben-BearFish

    Joined:
    Sep 6, 2011
    Posts:
    1,204
    I was wondering if it is possible to add 3D meshes to the 2D Sorting Layer somehow?

    Currently, I have a 2D sprite as my scene background with it 0 in the Sorting Layer. I need a foreground 3D plane in front of the 2D background sprite, but because of the sprite shader, the 3D mesh plane is drawn behind the background. Was wondering if there is a way to fix this?
     
  2. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    If you have the plane use one of the sprite shaders, then you can do renderer.sortingLayerID = x, where x is a higher layer than the one used by the sprite.

    --Eric
     
  3. Ben-BearFish

    Ben-BearFish

    Joined:
    Sep 6, 2011
    Posts:
    1,204
    Thanks Eric that worked. Is there someone at Unity I can contact to tell them their documentation on Renderer.sortingOrder, Renderer.sortingLayerName, and Renderer.sortingLayerID is blank?