I need to make it so that when you hold down "Fire1" the player shoots continuously until you release. Is there a way to do that? Here's the script I'm using to shoot:
The script works but all I need is to make shoot continuously when holding a button down. Please help.
asked Aug 05, 2011 at 10:08 PM
you need to create a "fireSpeed" variable, so var fireSpeed = .5 will make them fire every half a second. then all you need is in your if statement,
if(Input.GetButton("Fire1") && Time.time > firespeed)
what that does is compares the current time passed to your firespeed. I believe that's what you're looking for.