Wierd issue with Coroutines?

I am finding it very annoying to just yield in code. I have this :

IEnumerator reArrangeChunkOrderToMatchSystem(int dir)
    {
        GameObject[] newData;

        if (dir != 6)
        {

            switch (dir)
            {
                case 0:

                    newData = new GameObject[loadedChunkRadius * worldChunkDefaultLoadedHeight];

                    for (int i = 0; i < loadedChunkRadius * worldChunkDefaultLoadedHeight; i++)
                    {
                        newData *= ChunkInstance;*

}

int temp = 0;
for (int i = 0; i < loadedChunkRadius * worldChunkDefaultLoadedHeight * loadedChunkRadius; i++)
{
yield return new WaitForSeconds(0.1f);
Vector3 a = loadedChunks*.transform.position;*
if (a.x == centerChunk.pos.x - 96)
{
loadedChunks_.transform.position += new Vector3(16 * (loadedChunkRadius - 1), 0, 0);
Vector3 vec = new Vector3(loadedChunks.GetComponent().chunk.pos.x, loadedChunks.GetComponent().chunk.pos.y, loadedChunks*.GetComponent().chunk.pos.z);_
_reloadChunkDataOrGenerateNew(vec, loadedChunks);
temp++;
}*_

}

break;
The issue is that it wont wait for 0.1 seconds, it will just literally stop the whole function from working. I dont know whats going on and there are no errors but everything after the yield doesnt work any more. Am i doing something obvious that is wrong?
I also started the coroutine in the start function so it should work.
void Start ()
{
StartCoroutine(“reArrangeChunkOrderToMatchSystem”,6);
}
All i want to really do is add a delay to the part where the yield is currently placed so that it slowly streams the data rather than doing everything in a chunk.
Thanks,

The yield is correct - it should cause a 0.1 delay each loop iteration, and without hanging Unity. Maybe your problem has another cause. Is this for correct?

for (int i = 0; i < loadedChunkRadius * worldChunkDefaultLoadedHeight * loadedChunkRadius; i++){

loadedChunkRadius is being multiplied by itself and by worldChunkDefaultLoadedHeight, and if there’s no enough loadedChunks elements you will get a runtime error (Out of Range), aborting the script. Should loadedChunkRadius be multiplied by itself?

im a little confused how your code is getting there in the first place. You are calling that function with 6 as the dir parameter…However, in the beginning it checks if dir != 6 ???