Search Unity

Sprite Renderer and Mesh Renderer layer problems

Discussion in 'Scripting' started by LatchGameDev, Oct 4, 2015.

  1. LatchGameDev

    LatchGameDev

    Joined:
    Nov 24, 2014
    Posts:
    61
    Hello everyone.

    Context: Making a lock on system for a 3D action adventure game.

    How do I display a sprite in the world that is displayed on top of everything? My current problem seems to be that no matter what layer I set things on. Mesh Renderer objects will always display over Sprite Renderer objects. Uploaded a picture of what is happening with my tracking sprite.
    Problem.png

    So any ideas guys?
     
  2. GroZZleR

    GroZZleR

    Joined:
    Feb 1, 2015
    Posts:
    3,201
    You can use a different drawing layer, or a screen space UI canvas.
     
  3. LatchGameDev

    LatchGameDev

    Joined:
    Nov 24, 2014
    Posts:
    61
    I used layers and cameras to achieve what I wanted... Sort of. I have a new problem now tho. The render order is now DefaultLayer -> Lock On Circle -> Character. The only problem, the character is now rendered on top of everything in the game because she is on her own layer. Before when my character was on the default layer she could clip through the cubes in the level which is desired in this case.

    So basically I'd like to keep the character on the default layer with the world. Then have the cross hair above the world but below the character somehow.

    Problem2.png
     
    Last edited: Oct 5, 2015