How to modify the Blueprint FPS example to rapid fire?

Could someone please guide me towards a tutorial or hint that would explain how to modify the character blueprint contained in the FPS example to rapidly fire the gun with the left mouse button held down?

You can achieve this by using the gate node ([Gate node official documentation][1])

the idea is to loop every period of time (fire rate) and fire our projectile,

here is how to do so :

  • open “MyCharacter” blueprint and go to “Spawn projectile” code.
  • Add a sequence, a gate, a sequence and a retriggerable delay nodes
  • The first sequence node is to enter and open our gate when “Input action fire” event is pressed
  • The gate will be closed when “Input action fire” event is released i.e when we stop firing
  • when the gate is open we want to fire every period of time, and this why we need the retriggerable delay node

Here’s a snapshot of the final result :slight_smile:

you can change fire rate by changing the value of “Duration inside” “Retriggerable delay” node

Wow… Thank you so much. It’s like a difficult puzzle or something, I would have never figured that out on my own. How did you learn it? Well, my new gattling gun and I thank you immensely!!

“Retriggerable delay” node is not there anymore how can we do it now to shoot automatic

i found out with the delay component it has duration to

This is a great solution for this, many thanks!

I know this has been answered. But as a newbee I found the following alternative solution to this problem.

I set an timer which is looping (In this case it is triggered by event begin play, but could also be triggered by anything else) which calls the custom event “ShootingLoop”. Inside the ShootingLoop i then spawn the projectile etc. The fire rate is controlled by the time node on the timer. See screenshots.

However If I spawn multiple projectiles this way I have the feeling it eats a lot of ressources. Can someone with a little more experience explain which function is more expensive etc.?

Cheers!

there’s a problem with this: if you rapidly click, you could theoretically fire infinitely fast, since the first bullet always gets fired without a delay. this becomes very noticeable if you increase the waiting time.

here’s my version:

Note that Fire is just a custom event that fires one shot.

It’s definitely still there in 4.22.2

Does anyone know how to do this in UE 5.2.0?
Thanks
Will