The scene has a terrain and a fps controller. As soon as the player enters an invisible sphere, enemies start spawning. Now, the enemy (navmeshagent) prefab has a sphere child object which is a trigger and as and when player enters it, the enemy starts chasing the player. The problem is, the scene contains multiple instances of enemies at different locations, however, if the player is detected by a single instance of enemy prefab, all the instances of the enemy prefab in the scene start chasing the player along with the one who detected the player. How can I get that particular instance(the one that detected the player) only to chase the player while the other instances do nothing until they detect the player?
How are you calling the enemy chase function? If it’s a static, that’s why.