Disabled NavMeshAgent still use CPU !!

In my game on Global map, i have 5000 same NPC (with same Script - without Update/ MONO). NPC (who, out off range from hero) always disabled (Animator, NAvMeshAGent, SkinnedMesh - disabled). But if 1 of this NPC (one script - in range) working (nav.SetDestination from script) NavManager use 1.5 - 2ms (and other Unity component lose perfomance).
The performance drop directly depends on the number of NPCs (only when nav.SetDestination is running). Despite the fact that all elements on the NPC are turned off. It feels like the Navmesh system, when searching for a path, goes through all (even turned off) agents. What’s the point in that?

Look at perfomance (One screen 500 NPC - Second 5000 NPC). Third nav.SetDestination - (delete) - 5000 NPC . Problem in NAVMESH!

Sorry for bad English.



Do you have a system in check that setDestination is only called if an agent has reached its current destination?
If not then that amount of cpu usage isn’t unusual if your calling SetDestination on even 100 agents.

The distance of the path is also a factor, try and see if a path that’s say 30 units long has the same impact as one that’s 1000 units long