Creating and placing a 3D UI
Traditionally, UIs are static and are bound to the x
and y
axes. However, 3D UIs are more dynamic. As such, it is necessary to consider the placement of 3D UIs. In this recipe, you will learn how to place a 3D UI.
How to do it...
To begin, we need to create Canvas. We can do this by adding any UI element to the scene, as we have done many times during this book so far, or we can add it directly by right-clicking on the Hierarchy panel and then going to UI | Canvas.
Next, select Canvas in the Hierarchy panel, and in the Inspector, change Render Mode to World Space. Setting the Canvas to the World Space mode means that it is positioned in the space and it can be viewed from all the cameras within the world, provided they are pointed towards it.
Now that we are working in 3D, we need to keep the scale of our project in mind. As such, we need to make sure that we change the project settings from 2D to 3D. We do this in order to have adequate reference points (keeping...