I'm using Unity5 right now. I got this error when try to setDestination.
"SetDestination" can only be called on an active agent that has been placed on a NavMesh. UnityEngine.NavMeshAgent:SetDestination(Vector3) CompleteProject.EnemyMovement:Update() (at Assets/_CompletedAssets/Scripts/Enemy/EnemyMovement.cs:30)
My code.
Please advice. Thank you.
Reference: https://github.com/datomnurdin/SurvivalShooter
You need to add a Navmesh to your scene before you can use NavMeshAgent or anything else related to Navigation.
Here's some videos by Unity about Navigation
1.Make sure that your thirdPersonController is above the ground.
2.Go to Window->Navigation->Bake and click bake.The blue area is where the thirdperson can reach in the ground.
- Your floor (plane or quad) must be static.
- Add NavmeshAgent component your player or your enemy.
You can find static checkbox on inspector panel