Could some one take a look at my code and see what I’ve done wrong that makes it keep freezing up? This is a recurring problem with every solution for iterating room creation I’ve implemented. Could something other than an infinite loop cause Unity to freeze?
Code is below, I’ve tried to comment the purpose of code blocks. Ask if you misunderstand my intent anywhere. Thanks in Advance.
I’ve only briefly skimmed it, but you should verify that the loop in CheckForSpace(currentFloor) is actually dwindling the amount of space available. It looks like that will return true whenever there is any index in the floor that is of type indoors. I didn’t take the time to verify that you’re actually wiping out all instances of indoors inside of that loop.
Thanks, the debugger helped me find the problem. Turns out it was a value I set to 0 as a placeholder rather than be set to input. Along with a host of other minor problems.