Unityでオブジェクトを指定した場所を巡回させたいのですが、
とあるサイトを参考にしてやってみましたが全く動きません。
https://docs.unity3d.com/ja/current/Manual/nav-AgentPatrol.html
もしかしたら関係ないかもしれませんがこの文でエラーが起きています。
C#
1 if (agent.remainingDistance < 0.5f){ 2 GotoNextPoint(); 3 }
MissingComponentException: There is no 'NavMeshAgent' attached to the "ThirdPersonController 1" game object, but a script is trying to access it.
You probably need to add a NavMeshAgent to the game object "ThirdPersonController 1". Or your script needs to check if the component is attached before using it.
Patrol.Update () (at Assets/Patrol.cs:42)
参考になるサイトや、やり方があれば教えてください。
[追記]
どうしてもできないので↓のサイトを参考にしたのですがエラーの意味がよくわからないです。
https://gist.github.com/tsubaki/301d163cab865ad8fa17
IndexOutOfRangeException: Array index is out of range. Patrol.Update () (at Assets/Patrol.cs:13)
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。