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

Change order in layer in code?

Discussion in '2D' started by False_Baconator, Jun 21, 2019.

  1. False_Baconator

    False_Baconator

    Joined:
    Oct 2, 2018
    Posts:
    35
    Hi, I need some help.

    I need to access the order in layer of an object from within the code, so that i can make it higher or lower than another object as needed.

    sadly, i don't know how to do this, if there's an easy way to access the order in layer in the code, could you please tell me?
     
  2. Green11001

    Green11001

    Joined:
    Apr 14, 2018
    Posts:
    397
    Renderer.sortingOrder?
     
    False_Baconator likes this.
  3. False_Baconator

    False_Baconator

    Joined:
    Oct 2, 2018
    Posts:
    35
    thanks, that was super easy!