However, the startcoroutine inside the for loop does not seem to slow the for loop
No it doesn't. The result of your script is to instantiate all GameObject in the same frame as well as starting all your coroutines (which one has a different cooldown lasting for a different time).
I'm assuming that StartCoroutine is a seperate thread that runs aside from the Update thread and that's why the For loop is continuing, because it isn't waiting for the coroutine to finish.
No :). Coroutines lives all in the same thread. They are just iterator blocks. Citing Jon Skeet:
In C# 2, the compiler does all the hard work for you when you use iterator blocks to implement either IEnumerable or IEnumerator (or the generic forms). It builds a state machine for you, and the iterator obtained effectively executes the code within the iterator block, yielding values as it goes.
I think another way to describe them is cooperative multitasking.
I'm trying to write a For loop that instantiates multiple game objects in 1 loop, but I want to stagger their instantiate just slightly, say 0.5 seconds, before the next game object is instantiated.
Without considering the specific behavior you are implementing, a simple way to delay the instantiate calls (0.5 secs) is wrapping the for loop in a coroutine it self:
public IEnumerator DelayInstantiate()
{
for (int i = 0; i <= 3; i++)
{
Instantiate(gameObject, objectSpawn[i].transform.position, Quaternion.identity);
StartCoroutine(WeaponsCooldown(6)); //or do what you want
yield return new WaitForSeconds(0.5f);
}
}