unity-game-engine

How to make a canvas stay on top of the world?


My character has a Canvas above his head and I'm having a trouble on it mixing on another World objects.

enter image description here

How can I make the Canvas be displayed always on top of other world objects?

What I tried so far:

canvas.renderMode = RenderMode.WorldSpace;
canvas.sortingLayerName = "Default";
canvas.sortingOrder = 100;

Any idea?


Solution

  • If you want to keep the render mode as World Space, How about using a Stack camera- Overlay?