Freeze on stop. Freeze when deleting GameObjects during runtime.,Slow to delete. Slow to exit play mode.
I've been trying to track a problem I'm having since upgrading Unity to the newest version.
Playing the program is fine. It runs, creating a hex board with multiple low-poly trees and rotating the camera while displaying a UI. The problem comes when I push the play button again, ending the program. Everything freezes for a while. This did not happen before I upgraded Unity.
More info:
I paused the game. No problem. The scene creates three maps, rotates around a center point and turns the maps on in a rotation (shows one at a time).
Here's the fun part: I delete one of the maps and it freezes. No scripts on these maps. There shouldn't be any coroutines accessing the maps. Simple mesh with textures.
I hope someone can help me track this down. Sorry if this is a wrong format, missing info, etc. First time posting.,I've been trying to track a problem I'm having since upgrading Unity to the newest version.
Created this code:
void createTest$$anonymous$$ap()
{
for (int x = 0; x < 100; x++)
for (int z = 0; z < 100; z++)
Instantiate (Prefab, new Vector3 (x, 0, z), Quaternion.identity);
}
Added a nice 7 vertices, four triangle hex. Two seconds to load, twelve to unload. Something is wrong. I think there is a bug or a problem with my laptop but even that doesn't explain how it takes six times more time to unload. Probably going to the bug board with this one.
Answer by Dartimos · May 29, 2017 at 04:42 AM
Spent a little time on this this weekend. Ultimately the Unity update has made the destruction or removal of gameObjects to take a longer time. Whereas creating them takes a short time, destroying them can take up to 100ms (my best estimate) each on an average machine. If you have 1000 gameObjects, you are looking at a minute and a half to shutdown.
I'll have to test if it's my Scene, program or Unity in general. I'll update again if I get around to testing an empty project, creating 1000 cubes and then destroying them.
Your answer
Follow this Question
Related Questions
How can I simulate a thread? 1 Answer
Scene freezes when I restart level 0 Answers
my game is freezing! 0 Answers
Freeze 2D GameObject 0 Answers
[ EDITOR ] How to lock \ freeze a gameobject from selection, but still visible? 1 Answer