We now have a Main menu, but our regular game level is showing a default UI. While it's fine for testing purposes, we may want to make something a little more custom for our finished product.
Start off by opening up any of the levels you've created that have the
AdvancedPlayer
prefab inside it (I choseChapter7_MeshingYourLevel
).From there select your
AdvancedPlayer
and look at it from the Inspector. One of the components you'll see is thevp_SimpleHUD
component.This is what draws the screen in the default way and can be a good reference when it comes to accessing variables. However, we do not want to use it in this case.
Right-click on the vp_SimpleHUD component and select Remove Component.
Now that we've removed the previous HUD, it's time to add in our own. Create a Canvas by selecting GameObject | UI | Canvas.
For our purposes we're going to be using Slider as the basis of our lifebar. To do that with the Canvas selected, go to GameObject | UI | Slider.
A slider...