MountainSide Studios MountainSide Studios - 5 months ago 26
C# Question

How To Disable A Select Collider

I have a character with 2 2D Colliders in Unity, one for the head, and one for the feet, How do I Disable only the Head Collider in C#.


Something like this:

public Collider2D headCollider;  // drag and drop head collider to this in inspector.

void DisableHeadCollider()
    headCollider.enabled = false;