Search Unity

Question Altering draw order for sprites in URP

Discussion in 'Universal Render Pipeline' started by Sinister-Design, Jan 12, 2021.

  1. Sinister-Design

    Sinister-Design

    Joined:
    Sep 19, 2015
    Posts:
    66
    I'm making a 2.5D game: characters and attack effects are 2D sprites in a 3D environment. I'm using URP and Unity 2020.2.0f1.

    Here's the problem: no matter what I do, I cannot seem to get attack effects to consistently render above character sprites. I've tried physically moving them closer to the camera--they still render behind the character sprites. I tried putting them on a higher layer--it does nothing. I tried putting them in layer rendered by the overlay camera in my camera stack--it doesn't work (even though this same layer renders TextMeshPro objects above everything just fine). I've even tried building them a custom shader and cranking the Render Queue up to 5000--no dice.

    I'm at a loss. How am I supposed to alter sprite draw order in URP? (I've uploaded screenshots of my settings in case you can see what I'm doing wrong.)
     

    Attached Files:

  2. Sinister-Design

    Sinister-Design

    Joined:
    Sep 19, 2015
    Posts:
    66
    (Note: I found this tutorial on Youtube showing how to set up a custom axis for Transparency Sort Mode--which would solve the problem if I were making a strictly 2D game, but since this game uses a mixture of 2D and 3D, the option does not appear in my URP Asset.)
     
    maax223 and sorcerersapprentice like this.
  3. maax223

    maax223

    Joined:
    Jan 6, 2022
    Posts:
    1
    Has anyone found a solution to this? I am using 2D sprites in a 3D world, so I also do not have access to these settings. I need the sprites to be rendered in order of Z position, but can't seem to find settings that work the same way while still rendering 3D in URP.