Having trouble with Physics.IgnoreCollision().

I was trying to use Unity - Scripting API: Physics.IgnoreCollision but i’m currently having problems. Right now what i’m trying to do is give a certain object permissions to go through another object. This is my code -

  var Player : GameObject;
    function Start ()
    Physics.IgnoreCollision(Player.collider, collider);
    function Update ()

I attached this script to the object that i want “Player” to go through, and set “Player” as my player in the inspector (my player is currently a cube that can move around). But when i run it, my player still cant pass through the object i want it to pass through, do you know what i did wrong?

P.S. - sorry if this is a newbie question, i have a lot to learn about unity related things and and trying my hardest, thanks!

Physics.IgnoreCollision isn’t persistent, and has a bunch of drawbacks, so I wouldn’t use it.

The usual way to fix your problem is to set the player and the object the player should walk through on their own layers, and set those to not collide in the physics settings (Edit->Project Settings->Physics).

Hope that helps!