Answers for "unity deactivate all colliders of a gameobject"

C#
2

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
     }
 }
Posted by: Guest on May-08-2021

Code answers related to "unity deactivate all colliders of a gameobject"

C# Answers by Framework

Browse Popular Code Answers by Language