New answers tagged raycasting
You should use raycasting to check for visibility. Each raycast is expensive, so stagger the visibility checks for different enemies (they don't all have to see the player on the same frame)
You should write a method that checks the visibility. It follows the definition: http://en.wikipedia.org/wiki/Visibility_%28geometry%29 There are a lot of techniques to do that. Therefore, I reccomend you searching on the web which approach would fit best in your problem.
I fixed this problem by doing this : rocketInstance.LookAt(hit.point); instead of this : rocketPrefab.LookAt(hit.point);
Top 50 recent answers are included