unity check if theres a wall between code example
Example: unity check if theres a wall between
RaycastHit hit;
if (Physics.Linecast (transform.position, target.transform.position, out hit))
{
if(hit.transform.tag == "player")
{
//do something
}
}