学员(7715)
课程(185)
分享
我在脚本的onenable中设置agent.setdestination为一个物体的位置,但是无效(这个物体存在且enable);
但是我在update中通过点击这个物体的方式获取他的位置agent.SetDestination(hit.collider.transform.position);就可以寻路。
两次的pos是同一个物体的。
onenable是先于start执行了
你是不是在start里面把meshagent禁用了或者停止运行等类似的操作