NavMesh.Raycastをつかって、モンスターとプレイヤーの間にRayを飛ばして
障害物の有無を確認しているのですが、具体的に障害物とは何を意味するのでしょうか?
Coliderがアタッチされているオブジェクトのことでしょうか? Staticでベイクされているオブジェクトのことでしょうか?
お答えいただくと幸いです。
参考までにスクリプトを張っておきます。
void Update () { Debug.Log (count); NavMeshHit hit; if (agent.Raycast (target.position, out hit)) { //見えない count = count + 1; if (count < 600) {//まだ見えてる agent.SetDestination (target.position); } else {//もう見えない bolume.volume = 1.0f; Randomroot way = GetComponent<Randomroot>(); way.Randomway (); } } else { //見える count = 0; bolume.volume = 1.2f; agent.SetDestination(target.position); } }
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/01/18 04:58