MountainSide Studios MountainSide Studios - 1 month ago 6
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;