Collider characterController = GetComponent<CharacterController>(); Collider otherCollider = otherGameObject.GetComponent<Collider>(); Physics.IgnoreCollision(characterController, otherCollider);