- Home /
can i change collider type in run time
is it possible?
Comment
Answer by efge · Feb 21, 2011 at 11:28 PM
You have to disable/destroy the old one and use AddComponent to add a new one, e.g.:
Destroy (collider);
...
gameObject.AddComponent ("SphereCollider");
Well, disable isn't possible since a collider can't be disabled. So destroying the old one and add a new one is the best solution. Sure you can have multiply child GOs and enable/disable the GameObject with the collider on it.