SetDestination error on Enemy death

I keep receiving this error and have tried multiple ways of trying to fix it.

“SetDestination” can only be called on an active agent that has been placed on a NavMesh.
UnityEngine.AI.NavMeshAgent:SetDestination (UnityEngine.Vector3)
EnemyAI:ChaseTarget () (at Assets/Scripts/Enemy/EnemyAI.cs:73)
EnemyAI:EngageTarget () (at Assets/Scripts/Enemy/EnemyAI.cs:55)
EnemyAI:Update () (at Assets/Scripts/Enemy/EnemyAI.cs:36)

It only does this on enemy death

Hi,

That’s a known error message which does not affect our game. For this reason, we decided to ignore it.

If you want to fix it, use an if-statement and check the state of the NavMeshAgent component before calling SetDestination(). There is an example in the API.

Did this help?


See also:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms