Hello there!
I know, there is lots of these question out there, but I just don’t find any cause for this problem:
The NavMesh agent won’t move at all! As you see in the image, everything seems to be calculated correctly, but nothing happens. Here is the GameObject of the Agent:
Also, this is the attached script:
using UnityEngine;
using System.Collections;
public class TestNav : MonoBehaviour {
// Use this for initialization
void Start () {
GetComponent<NavMeshAgent>().destination = GenerateRandomPosition();
}
// Update is called once per frame
void Update () {
}
Vector3 GenerateRandomPosition()
{
Vector3 ret = new Vector3();
ret.x = Random.Range(-15f, 15f);
ret.z = Random.Range(-300f, 300f);
ret.y = 0.5f;
return ret;
}
}
Does anybody know what the problem is?