Rendering an object on top of everything is sometimes required in Unity3D. For example, you may have a 3D UI with a health bar that you want to display on top of everything, or a 3D UI menu that should be rendered above all other objects in Unity3D. Fortunately, there is a simple and efficient way to accomplish this by adding an additional camera that will render your specific game object or User Interface (UI) layer on top of everything else.
To achieve this, follow these steps (you can also watch my tutorial here):
- Create a specific layer with an appropriate name such as "TopUI" or "TopObjects".
- Assign this layer to the game object(s) that you want to render on top, such as the UI game object.
- Create a child camera game object under your main camera.
- Ensure that the child camera game object has a position and rotation of zero.
Render on top of everything in Unity |
0 Comments