45 second pause at scene load, from "mesh.bake scaled mesh physx collisiondata" called twice

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.

Any ideas? This is a really bad issue, I can’t show my game off in this state. The scene loads and then everything halts for over 20 seconds as Unity does some sort of “collision baking” before it continues. Can I somehow make it bake the collisions ahead of time?

OK, this is happening whenever a gameobject with mesh collider is spawned, it pauses the entire game as it does that baking. How can I avoid this? Any help?

Is the “Inflate Mesh” checkbox enabled in the MeshCollider? If so, try disabling it.

Looks like the Inflate Mesh feature may cause a significant performance penalty, as described in this thread: