- Home /
How can i make GUI ammo
HI,HI,HI , HOW CAN I MAKE GUI AMMO SCRIPT THAT SHOW THE CURRENT AMMO IN GUN AND THE LEFT AMMO , AND WHEN I RELOAD ,THE AMMO LEFT IS Decrease
Plz type script
Answer by Andrea_Marchetti · Jul 19, 2017 at 07:17 PM
Make a singleton that you will use as a GameManager so you can save all the variables about the game and you can access them everywhere in your code.
Then create a new script for the whole GUI.
Reference the UI you want to use for showing the ammo in the new script and in the Update function update the value taken from the singleton.
So you just update the singleton variable anytime you need from everywhere in your code and the value will be shown.
Your answer
Follow this Question
Related Questions
Gun with ammo help 1 Answer
Reload Mobile 0 Answers
reload gun with bullets 2 Answers
How do I make an object move? 3 Answers
Gun script reload problems 3 Answers