I’ve got a game spawning a bunch of cars (cloning existing cars in the scene) at scene load, and I just replaced box colliders on each car with mesh colliders that fit the shape of the car better (this is something we need based on what we are doing with this, we can’t use box colliders). But now after loading the scene, the game pauses for 45 seconds - 22.5 seconds total when calling GameObject.Instantiate to spawn the cars, and then again when setting their transform.parent.
These cars aren’t static, their mesh colliders are convex, their scales are all 1,1,1 all the way up the parent chain. The cars all have Rigidbodies, but on the root object, not the children with the mesh colliders.
Any ideas how to fix this issue? Would it be possible to do this “bake” during compile time rather than run time? This is a rather serious problem. After that initial pause everything seems fine.
Edit: I cut the time in half by setting the parent in the Instantiate call rather than a separate call afterwards, so it only bakes collisions once.