- Home /
I found another answer online
Reload indicator with a slider
Hello, I'm a beginner when it comes to programming and in my game, I wanted to make a slider which tells you how long the player has been reloading for. So when the slider comes to the end you know the reloading is finished and you are ready to shoot. This is what I thought of this code:
void Reload() %|-1604941968_1|% %|339816558_2|% %|-1716249033_3|% reloadTimer = 0; void Update() { //The reloading time is 1 second, I set the max value to 100 %|-178451797_6|% %|1015751105_7|% reloadSlider.value = reloadTimer; if(Input.GetKey(KeyCode.R)) %|1182448592_10|% Reload(); } }
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Slider to modify a countdown time in another scene ? 1 Answer
Slider to modify a countdown time in another scene 0 Answers
Slider to modify a countdown time in another scene 0 Answers