What I am in need to achieve is to have a Sprite always facing the camera identically to what happens with any simple game UI object, but instead of always displayed above everything else, it should be always displayed behind everything else.
How can I achieve that in Unity using C#?
Regarding the always-behind rendering, I tried setting the Sprite's "Order in Layer" to 0 or to negative values, with no success. I also tried setting all game objects to a greater value than the sprite's:
go.GetComponent<Renderer>().sortingLayerName = "Test"; go.GetComponent<Renderer>().sortingOrder = 1;
That did not work as well.
What would be the correct way of making a sprite to be always displayed behind everything else (other sprites, GUI and 3D meshes) - preferably not having to resort to shaders, if possible?
PS:regarding the effect of the Sprite always facing the camera as in a game UI, I suppose it will be only a matter of updating its rotation towards the camera - but I would be happy to find out if other approaches are avialable/more suited to the task.