On an object with a big number of colliders, where every collider attached directly to rigidbody, collider change will take alot of time. I can imagine it’s because of the mass center recalculation and other more complex internal calculations. Or now I’m remembering that I heard that all colliders have to be rebuilt, whenever changes occure.
The only way to optimise it that I found is to disable the collider, then modify it (if there are several modification required) then enable back. So my quastions:
-
What actually happens when collider gets modified?
-
Is it possible for Unity engine developers to optimise collider modification, so that this update of the rigidbody, whatever it is, will not be called after each collider being added or modifyed? For example so that I can add a number of new colliders and then call the update manually.