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");
}
}