Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

unity deactivate all colliders of a gameobject

public void SetAllCollidersStatus (bool active) {
     foreach(Collider c in GetComponents<Collider> ()) {
         c.enabled = true; //Or false if you want to desactivate them all
     }
 }
 
PREVIOUS NEXT
Tagged: #unity #deactivate #colliders #gameobject
ADD COMMENT
Topic
Name
5+8 =