i need some help about destroying colliders.
to speed things up i am trying to optimize some functions. i have a bunch of objects that have mesh colliders. mesh colliders work very well for precise selection but when i need to interact with a lot of objects and chech OnTriggerEnter everything slows down terribly.
i tried with boxcollider and it works very fast. when i do need precision selection i would like to turn meshcolliders back on objects to replace the boxcolliders. i tried to track what object i replaced meshcollider with boxcollider and later just loop through the array and to replace boxcollider with meshcollider
here is what i tried:
first i declared the array that will hold the colliders
then in every OnTriggerEnter i have this code:
this way i have array that holds all colliders that we changed collider type, so that i can track them and restore them later.
here is the function that should replace box colliders with mesh colliders when i need precision selection
it replacing mesh with box collider works, but returning back from box to mesh collider does not... any ideas?
asked Mar 01 '11 at 05:05 PM