[continued here due to lack of characters]
I’m not sure if this next part will mean much to you, but this is how I added the delay to the guns firing.
void ABattery::DelayFiringOrder(int32 gunIndex) {
float delay = FMath::RandRange(0.1f, maxDelayBetweenRounds);
switch (gunIndex) {
case 0:
GetWorld()->GetTimerManager().SetTimer(GunOneTimerHandle, GunOneTimerDel, timeBetweenVolleys, true);
DelayTimerDel.BindUFunction(this, FName("DelayFiringOrder"), 1);
GetWorld()->GetTimerManager().SetTimer(DelayTimerHandle, DelayTimerDel, delay, false);
break;
case 1:
GetWorld()->GetTimerManager().SetTimer(GunTwoTimerHandle, GunTwoTimerDel, timeBetweenVolleys, true);
DelayTimerDel.BindUFunction(this, FName("DelayFiringOrder"), 2);
GetWorld()->GetTimerManager().SetTimer(DelayTimerHandle, DelayTimerDel, delay, false);
break;
case 2:
GetWorld()->GetTimerManager().SetTimer(GunThreeTimerHandle, GunThreeTimerDel, timeBetweenVolleys, true);
GetWorld()->GetTimerManager().SetTimer(VolleyTimerHandle, this, &ABattery::EndFiringOrder, ((timeBetweenVolleys * numberOfVolleys) + 1), false);
break;
}
}
In UE4 C++, the TimerHandle is the typically method fro adding delay.
I just set a timer looping that repeatedly calls a function until EndFiringOrder() is called at which point, all of the loops are stopped. The main advantage to this was that I was able to add a random bit of delay between each gun firing.
In blueprint, perhaps you could try a for loop with a delay. Then, you could loop for as many rounds as you want firing. Take a look at some of the answers here: https://answers.unrealengine.com/questions/50642/question-how-do-i-add-a-delay-to-each-iteration-of.html
Again, I don’t mind helping you set something up in BP, if what I’ve said already doesn’t help you. ^^