添加新物体,命名为Player,添加组件Nav Mesh Agent.同时添加Navigation,将
需要进行自动寻路的地方进行烘焙。创建脚本Follow:
using UnityEngine; using System.Collections;
public class Follow : MonoBehaviour
{
public Transform target;
private NavMeshAgent agent; void Start() { agent = GetComponent<NavMe |
[Unity3D]Unity3D自动寻路Demo
最新推荐文章于 2025-07-11 14:22:47 发布
