If you are trying to make that the enemy is following the player with a script and a NavMesh agent, but its not working and got this error:
SetDestination” can only be called on an active agent that has been placed on a NavMesh.
UnityEngine.AI.NavMeshAgent:SetDestination(Vector3)
The solution to the problem
In Unity, NavMesh is handled from the Navigation window (menu: Window > AI > Navigation > Bake). The solution of the problem just click on Bake.
I hope it helped somebody else who runs into similar issues. If you’re interested in what I’m up to, please check out my other articles. Happy coding!
Also read: How to Delete Edge or Vertex in Unity
References:
https://forum.unity.com/threads/setdestination-can-only-be-called-on-an-active-agent-that-is-on-a-navmesh.599221/
Ambiz Education Search: