title: Unity C# Check if GameObject is not visible for cam PROBLEM
body: <p>I have a AimBot script that check how many enemy on the level, if  they in a specifity Range and now if they are visible from cam. I have found this two codes but both say that the enemy behind a wall is visible.
  Sorry for bad english ^^</p>
  
  <p>Code1</p>
  
  <pre><code>    //https://answers.unity.com/questions/8003/how-can-i-know-if-a-gameobject-is-seen-by-a-partic.html
      bool IsTargetVisibleV1(Camera c, GameObject go)
      {
          var planes = GeometryUtility.CalculateFrustumPlanes(c);
          var point = go.transform.position;
          foreach (var plane in planes)
          {
              if (plane.GetDistanceToPoint(point) &lt; 0)
                  return false;
          }
          return true;
      }
  </code></pre>
  
  <p>Code 2</p>
  
  <pre><code>    bool IsTargetVisibleV2(Camera cam,Renderer[] ren)
      {
          foreach (Renderer renderer in ren)
          {
              if (renderer.isVisible)
              {
                  return true;
              }
          }
          return false;
      }
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/wKxxX.png" alt="Player_Cam">
  <img src="https://i.stack.imgur.com/eoY01.png" alt="Minimap_Cam"></p>