how to use ignore layer collisions

i am trying to set up a collider to ignore colliders of other layers, buttttttt i dont know exactly how it works :/

atm i have

var mask1 : LayerMask;
var mask2 : LayerMask;

Physics.IgnoreLayerCollision (mask1, mask2);

What am i suppose to be doing?

I know its been awhile, but I was trying to figure out the same thing today and came across your question. Incase you were still looking for the answer, try adding a boolean at the end. Ex:

var mask1 : LayerMask;
var mask2 : LayerMask;
 
Physics.IgnoreLayerCollision(mask1, mask2, true);

http://docs.unity3d.com/Documentation/ScriptReference/Physics.IgnoreCollision.html