"Stop" can only be called on an active agent that has been placed on a NavMesh.

mikec

Master Of All That I Survey
Retired Staff
Trusted Member
Jul 12, 2014
296
152
28
Los Angeles, California, USA
Animals sometimes get underneath the terrain in certain areas. There is a low hill in the middle of Resource Valley where this happens often. You're walking around and hear bears barking, but can't see them. When you get to the other side of the hill the bear emerges from the edge of the slope. The agent refers to a NavMeshAgent game object that navigates the NPC on the NavMesh.

There's a couple of things that might work to remove or reduce these. NavMeshAgent has some properties that can be checked to see if it has a valid path. There are some other methods like Stop and SetDestination, but as you guessed, they aren't available when the agent is off the NavMesh. So they can't be used to put it back on the NavMesh. The thing to do is to run a timer, check NPCs for invalid path, and destroy the ones with an invalid path.


Failed to create agent because it is not close enough to the NavMesh
Failed to create agent because it is not close enough to the NavMesh
"SetDestination" can only be called on an active agent that has been placed on a
NavMesh.
"Stop" can only be called on an active agent that has been placed on a NavMesh.
"SetDestination" can only be called on an active agent that has been placed on a
NavMesh.
"Stop" can only be called on an active agent that has been placed on a NavMesh.
"SetDestination" can only be called on an active agent that has been placed on a
NavMesh.
"Stop" can only be called on an active agent that has been placed on a NavMesh.
"SetDestination" can only be called on an active agent that has been placed on a
NavMesh.
"Stop" can only be called on an active agent that has been placed on a NavMesh.
"SetDestination" can only be called on an active agent that has been placed on a
NavMesh.
"Stop" can only be called on an active agent that has been placed on a NavMesh.
"SetDestination" can only be called on an active agent that has been placed on a
NavMesh.
"Stop" can only be called on an active agent that has been placed on a NavMesh.
"SetDestination" can only be called on an active agent that has been placed on a
NavMesh.
"Stop" can only be called on an active agent that has been placed on a NavMesh.
"SetDestination" can only be called on an active agent that has been placed on a
NavMesh.
"Stop" can only be called on an active agent that has been placed on a NavMesh.
 
  • Like
Reactions: .phase

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,095
4,815
113
At your house.
github.com
Animals sometimes get underneath the terrain in certain areas. There is a low hill in the middle of Resource Valley where this happens often. You're walking around and hear bears barking, but can't see them. When you get to the other side of the hill the bear emerges from the edge of the slope. The agent refers to a NavMeshAgent game object that navigates the NPC on the NavMesh.

There's a couple of things that might work to remove or reduce these. NavMeshAgent has some properties that can be checked to see if it has a valid path. There are some other methods like Stop and SetDestination, but as you guessed, they aren't available when the agent is off the NavMesh. So they can't be used to put it back on the NavMesh. The thing to do is to run a timer, check NPCs for invalid path, and destroy the ones with an invalid path.

Failed to create agent because it is not close enough to the NavMesh
Failed to create agent because it is not close enough to the NavMesh
"SetDestination" can only be called on an active agent that has been placed on a
NavMesh.
"Stop" can only be called on an active agent that has been placed on a NavMesh.
"SetDestination" can only be called on an active agent that has been placed on a
NavMesh.
"Stop" can only be called on an active agent that has been placed on a NavMesh.
"SetDestination" can only be called on an active agent that has been placed on a
NavMesh.
"Stop" can only be called on an active agent that has been placed on a NavMesh.
"SetDestination" can only be called on an active agent that has been placed on a
NavMesh.
"Stop" can only be called on an active agent that has been placed on a NavMesh.
"SetDestination" can only be called on an active agent that has been placed on a
NavMesh.
"Stop" can only be called on an active agent that has been placed on a NavMesh.
"SetDestination" can only be called on an active agent that has been placed on a
NavMesh.
"Stop" can only be called on an active agent that has been placed on a NavMesh.
"SetDestination" can only be called on an active agent that has been placed on a
NavMesh.
"Stop" can only be called on an active agent that has been placed on a NavMesh.
"SetDestination" can only be called on an active agent that has been placed on a
NavMesh.
"Stop" can only be called on an active agent that has been placed on a NavMesh.
@balu92 and I were trying to remove the NPCs some time ago. Problem is that it also requires to remove the Resources as i was testing further. Bypassing this would be nice.
 
  • Informative
Reactions: .phase