我正在统一制作游戏,它抛出错误“无法创建代理,因为没有有效的导航网格”,我不知道问题是什么。
using UnityEngine;
using System.Collections;
public class EnemyMotion : MonoBehaviour {
public NavMeshAgent agent;
public Rigidbody rb;
public GameObject otwt;
void Start () {
rb = GetComponent<Rigidbody>();
agent = GetComponent<NavMeshAgent>();
}
void Update () {
gameObject.transform.Rotate(270, 0, 0);
agent.SetDestination(otwt.transform.position);
}
}