LayerMask - IgnoreCollider not working

I searched for topics which could help me, but I don’t find anything that fix my problem.

I’m using RayCastAll to get a list with colliders touch the ray, but I need ignore some layers and I having problem with it.

    public LayerMask ignor;
    public Transform Player;

    RaycastHit[] colid;

    private void Update()
    {
        colid = Physics.RaycastAll(transform.position, Player.position, ignor);

        for(int i = 0; i < colid.Length; i++)
        {
           Debug.Log(colid.Length);
            if (colid*.collider.tag == "Player")*

Debug.Log(“I’m seeing him!”);

else
Debug.Log(“I’ts clean”);
}
}
The objects on layer ignor are detected yet, and I don’t know why. Some help?

The documentation for RaycastAll is poorly worded. Your layermask should include the layers you want the raycast to hit, not the layers that should be ignored.