###前提・実現したいこと
NavMeshAgentを使ってプレイヤーを追いかけるスクリプトを作りたいです。
初めてなのでサイトを参考にやってみましたが上手くいかず、原因が分かりません。
###発生している問題・エラーメッセージ
Assets/ENEMY1.cs(7,2): error CS0246: The type or namespace name `NavMeshAgent' could not be found. Are you missing `UnityEngine.AI' using directive?
###該当のソースコード
using System.Collections; using UnityEngine; public class ENEMY1 : MonoBehaviour { public gameObject target; NavMeshAgent agent; // Use this for initialization void Start () { agent = GetComponent<NavMeshAgent> (); } // Update is called once per frame void Update () { agent.destination = target.transform.position; } }
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/01/11 08:52