Now, we will add the 2D GUI that we created in Chapter 2, GUI Time.
Drag-and-drop the GUI_2D
script onto the First Person Controller. Since we already have everything coded, your work is almost done for the GUI! In the scene, create a new empty GameObject and name it Empty
; this will be used by the script. If you don't have default values for your GUI_2D
script, set them to these values:
100
100
0
1
100
0
0
100
With all of this added, when you run the scene it should look like this:
3.14.129.194