MountainSide Studios MountainSide Studios - 1 year ago 116
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#.

Answer Source

Something like this:

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

void DisableHeadCollider()
    headCollider.enabled = false;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download