Each time that I create a mesh collider to an object it freezer for a few moments, is it possible to create a mesh collider without taken that much time
1 Answer
1If it is possible for you to create the collider before you need it then that would be a better way to do it. Mesh colliders are expensive in general, and creating it while playing will take some time depending on the number of verts of your mesh.
If you do not generate the mesh at runtime then you should create the collider before you need it (by assigning a mesh collider in the editor and disabling it) and just turn it on when you do.
if i do that, will it take that little freeze anyway?
– Wdarkfenixiwaldrop let me answer that for you : yes.
– Unitraxxok i re-read the answer, the problem is, I am generating de mesh at runtime
– WdarkfenixRight. Then, obviously, the suggested method wont work for you. :( What you're running up against is a well-known limitation of current generation hardware/techniques. You can read more about that [here][1] and [here][2]. [1]: http://answers.unity3d.com/questions/315059/how-to-improve-performance-while-generating-extrud.html [2]: http://answers.unity3d.com/questions/321428/adding-mesh-collider-in-run-time-slow.html
– iwaldrop