【发布时间】:2018-11-02 11:20:02
【问题描述】:
NavmeshAgent 玩家在翻山时不平行到山坡。在平面上它进展顺利。
下面是导航网格和播放器的图像属性 https://ibb.co/fijmoV
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.AI;
public class SampleAgentScript : MonoBehaviour {
public Transform target ;
NavMeshAgent agent;
// private static bool start1=false , start2=false, start3;
// Use this for initialization
void Start()
{
agent = GetComponent<NavMeshAgent>();
}
void Update()
{
//if white button click moves to targer-1
agent.SetDestination(target.position);
}
}
【问题讨论】:
-
将对象接地不是导航网格代理的工作,您可以将刚体组件添加到游戏对象并应用重力,然后您的对象将被接地。
-
如果我使用刚体重力,它会向下倾斜。它不会瞄准