unity ignore collision between two objects
private void OnCollisionEnter(Collision collision)
{
if (collision.gameObject.layer == layerToIgnore)
Physics.IgnoreCollision(collision.gameObject.GetComponent<Collider>(), GetComponent<Collider>());
}