Phase 1 — Ammo Count

Nicholas Lim
Jun 1, 2021

The Player will now be given a limited ammo count of 15 to prevent laser spam.

Create another Text UI element under the Canvas and call it something like “Ammo_count_text”. Update the following in the UI Manager script.

UI Manager script

As the game starts the ammo is full, and as it’s being fired the text will be updated with the remainder.

In the Player script, it will have a int variable for the ammo. The Player can only fire it they have ammo, which decrements when fired, and updates the UI Manager.

Player script

--

--