Hi I am pretty new to scripting. I just finished my first class using Unity and we made a carnival type shooting gallery game and was wondering how I could visualize the down time between each shot that is allowed to be taken. I believe the time is around 2.5 to 3 seconds. I would like some kind of progress bar to show at the bottom of the screen. Any help with this would be great. Even a general direction to head in would help.
You could use something like this (I think)
var timeBar : Texture2D;
var time = 0.0;
function OnGUI(){
time = 0.0;//set it to whatever the down time is
GUI.DrawTexture(Rect (0 /*left*/,0 /*top*/,time /*how far the right side is*/,timeBar.height), ammoBar);
}
This would give you a bar at the top left of the screen
that grows the higher “time” gets. But I don’t know
how your “down time” system works so you’ll have to
figure out how to set “time” on your own.
Awesome, thank you. My reload down time is just based on a refire rate script that our teacher showed us. I think it is very similar to the one used in the FPS tutorial Unity provides.