Download

Help creating weapons

So I’m making a game, it’s an fps, and I need help with a sniper I’m making. I currently have it able to shoot but you can just click and click and shoot with no delay. Is there a way i can make it so once you shoot you have to wait 1 second play an animation then be able to shoot again? Thank you, Im pretty new to coding so any videos etc would be very helpful.

You could make a bool variable CanShoot and set it to true by default, then when you have the event that fires the gun, check if CanShoot is true, and if it is, set it to false, do your fire mechanics, play the animation, use a delay, and at the end of the delay set CanShoot back to true.

Thanks a lot I’ll do that :slight_smile: