Switching Weapons

Hey Guys

This question had me pondering for days, but I simply cannot figure it out: how do I switch to a weapon with a slower or more rapid fire rate? I’ve tried piecing together some Youtube tutorials as well as researching this topic on various websites; however, none of them offer the correct solution.

I have made slight modifications to the basic first person character template (now, the character can rapid fire). However, my character will still maintain the same fire rate if I switch to another weapon. For example, if I switched from my full auto assault rifle to a pistol, the pistol would still fire at the same rate as the rifle. How would I slow the fire rate down?

As a new student to the Unreal Engine, I have yet to grasp a full understanding of blueprints. This is my very first question on the forums, and I would appreciate any help. Thanks, and have an amazing day!

Hi Doudou29236,

as with most of the stuff there are several approaches to this, one is to use custom event and timers.

When you’re working in blueprint, under the weapon, you create following custom events:

  • PullTrigger
  • ReleaseTrigger
  • Fire

PullTrigger, when called will set a timer for function call, here you can define how much bullets you want to shoot per second. This timer will call the Fire custom event which will spawn a projectile, play sound and so on any time it’s called. The ReleaseTrigger will clear the timer, effectively stopping the fire.

Now, in your hero blueprint, on button pressed, you call the pulltrigger and on released, you call releasetrigger.

Check this video out, everything will be clear.

Regards,

Thanks dude! This method functions perfectly! Thanks again for the answer!

Hi Doudou29236,

I’m happy to hear that it worked out for you.
If you’re happy with the answer, can you please mark the post as answered?

Regards,