Currently I have a script attached to my enemy characters that tries to detect where the player is. it first uses a view cone as a trigger. if the cone is triggered, it checks with a line cast to see if there are any obstacles.
If both checks succeed, the enemy will now follow the player.
using:
AIFollow.target=GameObject.Find("PlayerModel").transform;
Debug.Log("current target is " + AIFollow.target);
chasing = true; display.Chasing();
However, right now. if one enemy see’s the player; ALL the enemies will follow it.
It’s pretty annoying, and I’m not sure how to fix the issue. If anyone has any ideas, please let me know, I’m happy to show any other code I’m using if it helps fix it.
also, as a bonus, what would be the best way to get the enemy to walk around randomly until the player arrives?
Thanks.