Hi, I tried to make a fire cooler, in which my hand gun shoots, the animation work, the raycast works, then it has to cool off for 0.5 seconds in order to re-fire. So I tried the following. I created a variable that is similar to my rate of fire and called it "ShootCooler, and then set it equal to each other after the fire function. But that didn't work. Here is my code without my trials:
asked Jul 20 '12 at 04:05 AM
seems to me that's already handled in this script.. in the Fire function, with
The fire function only gets entered once every .3 seconds, due to the FireRate.. If you move the lines
to the end, and put all your animation, sound, etc. calls above that, It will all only be called once every .3 seconds (or whatever the rate is set to).. isn't "Rate of fire" and "cool down time" the same thing?
as it stands now, the FireRate regulates both the cool down time between shots, AND the time it takes the bullet to reach its target.. so if that's what you intended, you could just add a second yield: