Question about Sorting layers according to Y axis

Hello !

I am new to Unity, and I am trying to make a 2D, top-down.I am wondering how I can sort the layer of objects based on their position of the Y axis NOT USING SCRIPT.

I read that i can do it by change to TransparencySortMode.Orthographic Mode. But i cant find it anywhere in my Camera. And i dont know what “distance along the camera’s view” mean when i create 2d Game.

I also read that i can Transparency Sort Mode but i cant find it in Edit > Project Settings > Graphics

Thanks for your Adive !

Hello @unity_qyNAJ9CdbDf9rw !
To set this up, you need to use the 2D rendering pipeline !

Create a 2D renderer pipeline asset and then assign it to the universal render pipeline asset you are using in the graphic settings ^^

Then you can set this up in the 2D pipeline asset ^^

This was answered here: Sorting layers according to Y axis - Questions & Answers - Unity Discussions

Using URP the option is no longer in the Settings. You have to use a script.

Something like this:

#if UNITY_EDITOR
using UnityEditor;
#endif

using UnityEngine;
using UnityEngine.Rendering;

#if UNITY_EDITOR
[InitializeOnLoad]
#endif
public class TransparencySortGraphicsHelper
{
    static TransparencySortGraphicsHelper()
    {
        OnLoad();
    }

    [RuntimeInitializeOnLoadMethod]
    static void OnLoad()
    {
        GraphicsSettings.transparencySortMode = TransparencySortMode.CustomAxis;
        GraphicsSettings.transparencySortAxis = new Vector3(0.0f, 0.0f, 1.0f);
    }
}

You can also just take URP off, change the setting, then add URP back on.