Stuck in a runaway loop

Hey guys. So what I am currently working on is a hex tile system that generates hexes in a hexagonal spiral formation. Like such:


Edit : If you want to know about the math behind all this

This allows as much expansion as you want, all you have to do is set the amount of hexagons. But I am having some trouble right at the moment. My blueprint is causing a run-away loop.
But I have no idea what is causing it. It has been a long day so maybe my logic is just off. Any help would be appreciated.

This is the start

This is where it starts getting the coordinates. The add part is one thing I was trying where I just get the coordinates in an array and then create the tiles base on the array later.

This is another way I was trying where it creates the tiles at the time. I am not sure if it even works because I can’t copy paste the add component part.

And this is where each side of the hex ring is created. I unhooked it after the first side to see if that is the problem, but that didn’t fix anything.

Well if you guys see anything I am blatantly doing wrong I am more than willing to accept criticism. I am pretty amateur at this and I just want to make it work. Thanks.

I just glanced at it, but the first thing I saw was the WhileLoop and I am guessing that is your problem. I would replace it with a ForLoop or ForEachLoop and dynamically set the input for those loops instead of using While. Get that working first and you can come back and try the WhileLoop again. I don’t know why, but anytime I tried using the WhileLoop it caused infinite loops even though I was pretty sure I was updating the the While Bool properly.

Also, I see a ForLoop in your last image that isn’t even connected. Not sure if that could cause a problem.

Generally though, put print strings all around your loops and that should show you the last working component before it goes infinite.

Ya that for loop was just unhooked to see if the infinite loop was in the iterations for the sides. Which it wasn’t because the loop was still infinite. But I will definitely try the for loop instead of the while loop.