Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Sorting layer for mesh renderer?

Discussion in '2D' started by Nero-R, Sep 15, 2015.

  1. Nero-R

    Nero-R

    Joined:
    Dec 29, 2014
    Posts:
    5
    as the title say i want to set a sorting layer for a non sprite renderer (mesh renderer) and i cant do it, tried many things but none of them works so i came here to see if i can find someone that managed to solve this problem.
     
  2. Nero-R

    Nero-R

    Joined:
    Dec 29, 2014
    Posts:
    5
    Solved this by script, but why this is not available from editor? or maybe there is a way to do it from editor, in wich case i really would like to know how to do it.
     
  3. leoyaik

    leoyaik

    Joined:
    Oct 13, 2014
    Posts:
    6
    You could write a custom EditorWindow that allows you to change it or via the inspector of another component.
     
  4. GiyomuGames

    GiyomuGames

    Joined:
    Jan 12, 2015
    Posts:
    80
    Hi Nero,

    You can find a custom Editor Window there: https://gist.github.com/nickgravelyn/7460288

    However, I am facing the same problem as you and I couldn't solve it by code or using the custom editor window. Which version of Unity are you using? and did you fix your problem just by setting the sortinglayername et sortingorder in the code or did you do something else?