I have a for loop in my Start function that runs through a set number of times doing intense calculations. Im creating hundreds of instances of prefabs then combining them into one mesh. This is really cool to watch if I use a yield; in the loop however it takes forever compared to letting it run in one frame. However I really hate those 5 seconds of being frozen and would like to have a loading bar stating the progress. Everything works except I can’t cause Unity to only pause every other frame. Ive tried this:
if(Time.frameCount % 2 == 0)
yield;
but it doesn’t ever pause. I added a debug in there once and it only ran once. I don’t get this, is there simple but effective way to do this?