目次 分かったこと1・「NavMeshPath」は「NavMeshAgent」の中にある 分かったこと2・「NavMeshPath.corner」の扱いとVector3の使い方 分かったこと3・「NavMeshAgent.destination」を設定してもすぐには「NavMeshPath.corner」は作られない 分かったこと…
C#のプレイヤー側のスクリプト名を「Player」、 別のオブジェクト側のスクリプト名を「Cursor」とし、 「Player」側で下記のプログラムを書いて、 direction = (GameObject)Resources.Load ("Prefabs/Cursor");GameObject cursor = (GameObject)Instantiate …
public GameObject player; private NavMeshAgent agent; void Start () { player = GameObject.Find("Player"); agent = GetComponent<NavMeshAgent>(); } void Update () { Vector3 forward = transform.TransformDirection(Vector3.forward); Vector3 targetDirection =</navmeshagent>…
private NavMeshPath path; public NavMeshAgent agent; public RaycastHit hit; public bool once = false; public bool targetF = false; if (Input.GetMouseButtonDown (0)) { if (Physics.Raycast (Camera.main.ScreenPointToRay (Input.mousePosition),…
ナビゲーションをSphere + Planeで普通に作っていくと こんな感じになるのだけど、 これをBakeして実行すると下の画像みたいにY座標がズレてしまう 補正のせいかY=0.666...という面倒なことになった。 色々と試行錯誤していった結果、 Navigation -> Bake ->…
Unity & C#初心者の私が、 ゲームを完成させてApp StoreにiPhoneアプリ公開するまでの努力を見せるだけのブログです。 どんなRTS(リアルタイムストラテジー)を作りたいかというと、 決戦2のようなゲーム いやー高校生くらいの時に親父が500円でワゴンから…