So here is the last thing I was working on for my City and Town spawner. it was a late night and was getting confused so i started commenting things out I didn’t know where i went wrong so bare with me.
RoadsSpawner.cs
i don’t know if the error is in this script or somewhere else. Basically I duplicated this script and named them streetlightspawner and propertyspawner with small modifications for each to suit the prefabs general shapes and pad spacing.
I am not getting any critical errors in unity my thoughts are the script is getting stuck in the while loop somewhere I just can see it.
If you would like to dig a bit deeper you can take a look at the script that spawns the road object. which is a script that spawns objects in a grid.
RoadsGrid.cs
Any help would be appreciated.
Thx
That is a lot of code to try and sort through to help you, but what I’d do if I were you, is start commented out sections of the code. Start by commenting the entire update / fixed updates of each script so nothing should be running in one or the other. If then the editor doesn’t crash, you can assume the problem is with the script you commented out.
Once you narrow that down, you start taking chunks of code out at a time. for instance that while loop in the first script might be the culprit… who knows though, it could be anywhere. Most likely though a loop is hanging on something it just can’t complete, either its stuck in an infinite loop, or something your doing is too much processing power and it is freezing up the main thread.
Ya I was afraid of that. Thx for the input. I was hoping it was something obvious I was over looking. I Love hunting for bugs! lol not so much.
fixed it. brakects man. brackets. where Rt++ is increased i must have deleted a if statement and didnt remove the last bracket and it through everything out of whack. ugh i was stuck for 2 days on that. but thx u made me think of debugging it a different way and had to step back for a min and keep it simple.
2 Likes
Good work! You can give a man a fish and he eats for a day. But teach a man to fish… 
Edit:
(Or woman, idk lmao)