Hey! I made a procedural dungeon script that execute on start. The project is 2d so when the grid is filled of “walls” and “floors” , I look at the walls dispositions and put the right wall sprite ,picking in a pool of 15 different ones. Then I choose random walls to put torches on them.The project is now slow to start since everything is done at start . When I hit the play button, it stops responding for 5-6 seconds before unfreezing. I know that start execute in one frame, so it freezes the game until the function executed completly. Is there a way to tell the game to carry on? To give more time to the function so it isn’t so glitchy?
You can use a coroutine for this. Or you can refactor it so that it you’re doing a bit of work each time Update is called, until it’s all done.