I’ve got a setup with 4 turrets, each instantiated at runtime, and their GameObjects stored in an array, which I use to send them targeting information.
My issue is that, currently, they all fire at once, which isn’t what I want. My intention is to use the same array to go through each turret in turn, and send their script a command to fire. My only problem (so far!) is that I can’t see how to institute a delay between each turret.
Here’s what I have:
function laserSequence () {
for (var tlist2 in GameObject)
{
tlist.GetComponent(turret_health_script).RemoteFireLaser () ;
}
}
How do I put a delay between each cycle of the for loop?