Controlling rate of fire

I’ve been frustrated with how quickly the gun fires. It’s loud, obnoxious, and unrealistic. I wanted to share a solution to controlling the rate of fire. It basically includes two new variables in the character blueprint. If written differently I’d likely prefer to put these in a separate gun blueprint, but I wasn’t looking to get that crazy. One variable (FireRate) is a const float that basically sets how fast the gun will shoot (it’s calculated in MS, so the lower the number the faster the rate of fire). NextShotTime (a regular float) tracks when it’s time to actually fire the next shot and resets when the trigger is released. Note that I’m using the new EI system and the screenshot is only showing up to the spawn emitter call.

Privacy & Terms