Let's see how to display the player's stored name above the character. It will look like this:
In order to display this name label, we'll need to configure the 2D UI Root
element that will only render 2D UI elements and make sure it follows the player.
We'll now add some in-game 2D user interface elements attached to 3D world objects. Let's create a new 2D UI root element that will be used exclusively for in-game 2D UI:
Create a new
2D UI
element by navigating to NGUI | Create | 2D UI.Select the new
UI Root (2D)
GameObject in the hierarchy.Rename it to
InGame2DUI
.For its attached
UIRoot
component:Change Scaling Style to Constrained
.
Set Content Width to
1920
.Set Content Height to
1080
.Leave its height's Fit option checked.
Now, let's create a new layer to hold all 2D UI
elements: