Looping projectile fire, random delay in BP

Very little experience in coding/BPs.

I need to setup a canon that fires a projectile continuously - with random time intervals between each fire.

Just wondering what the best/most economical way to do this is.

Thanks!

Create a custom event. Call it something like “Fire”. On Begin Play call this function. Put all your fire code in this function. At the end of the function have a Delay node with a “Random float in range” connected to it. After the delay call the Fire event again.

2 Likes

Id use a SetTimer by Event on BeginPlay, this gives you the option to loop with a delay (which can be randomized) and you can delay before you call it if you want an initial interval thats seperate, you can also pause/stop and restart the timer at any time, cool.

That will be handy! Thanks!

Worked like a charm! much appreciated!