How to use linecast ??

hi my friends.
i am working on my simple game.
its a ball that have third person shooter camera.
i have used Mouse orbit and Smoth Follow scripts.
my game works properly but i have a problem with camera.
my camera through wall in closed place.
i found out that i should use Physics.castline to detect collision between camera and actor (the ball).i wrote this code but its always true !
and never be false.

void Update()
{

    if (Physics.Linecast(gameObject.transform.position, wall.transform.position))
    {

        Debug.Log("collected");
    }
    if (Physics.Linecast(gameObject.transform.position, wall.transform.position)==false)
    {

        Debug.Log("not collected");
    }

}

1 make you ball in individual layer

2 when you need to check the ball by linecast, filter it by ball’s layer

or, simply add wall to ‘ignore raycast’ layer if you needn’t raycast them at all