Hi ! Im new in unity3d and i need some help...How i can solve this? if this is Spoiler: NAVMESHAgent using UnityEngine; using System.Collections; namespace CompleteProject { public class EnemyMovement : MonoBehaviour { Transform player; // Reference to the player's position. PlayerHealth playerHealth; // Reference to the player's health. EnemyHealth enemyHealth; // Reference to this enemy's health. NavMeshAgent nav; // Reference to the nav mesh agent. void Awake () { // Set up the references. player = GameObject.FindGameObjectWithTag ("Player").transform; playerHealth = player.GetComponent <PlayerHealth> (); enemyHealth = GetComponent <EnemyHealth> (); nav = GetComponent <NavMeshAgent> (); } void Update () { // If the enemy and the player have health left... if(enemyHealth.currentHealth > 0 && playerHealth.currentHealth > 0) { // ... set the destination of the nav mesh agent to the player. nav.SetDestination (player.position); } // Otherwise... else { // ... disable the nav mesh agent. nav.enabled = false; } } } }
Follow this tutorial. --> https://unity3d.com/learn/tutorials/modules/beginner/navigation/navigation-overview It sounds like you didn't "Bake" a navmesh yet. You have to do that in order to tell the NavAgent where is is allowed to go. That tutorial is great. Helped me understand it easily.