i make simple navmeshagent script. I want to make enemy walk to player, but iw not working,
This my script :
using UnityEngine;
using System.Collections;
public class EnemyScript : MonoBehaviour
{
public Transform Player;
NavMeshAgent agent;
void Start ()
{
agent = GetComponent<NavMeshAgent> ();
}
void Update()
{
agent.destination = Player.position;
}
}
my problem this :
how i can to fix this ??, please help me,