質問編集履歴
2
誤字
title
CHANGED
File without changes
|
body
CHANGED
@@ -8,6 +8,8 @@
|
|
8
8
|
言葉足らずで申し訳ありませんが回答の程よろしくお願いします。
|
9
9
|
|
10
10
|
**敵のプログラム**
|
11
|
+
|
12
|
+
|
11
13
|
using System.Collections;
|
12
14
|
using System.Collections.Generic;
|
13
15
|
using UnityEngine;
|
@@ -72,6 +74,8 @@
|
|
72
74
|
}
|
73
75
|
|
74
76
|
**敵の生成を管理するプログラム**
|
77
|
+
|
78
|
+
|
75
79
|
using System.Collections;
|
76
80
|
using System.Collections.Generic;
|
77
81
|
using UnityEngine;
|
1
書式の改善
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,5 +1,12 @@
|
|
1
|
+
前提・実現したいこと
|
1
|
-
|
2
|
+
シューティングゲームを作っています。敵が生成した位置からその時のプレイヤーの位置まで突撃する敵を作りたいのですがうまく動きません
|
2
3
|
|
4
|
+
発生している問題・エラーメッセージ
|
5
|
+
位置の取得がうまくいかずプレイヤーがX軸の0を超えると敵が反対方向に進んでしまいます。
|
6
|
+
それとstart関数で行っているため、最初だけしか取得できずランダム生成された敵の位置からプレイヤーに向かってではなく動いた幅分ズレて動くだけになってしまいます。
|
7
|
+
|
8
|
+
言葉足らずで申し訳ありませんが回答の程よろしくお願いします。
|
9
|
+
|
3
10
|
**敵のプログラム**
|
4
11
|
using System.Collections;
|
5
12
|
using System.Collections.Generic;
|
@@ -16,11 +23,6 @@
|
|
16
23
|
public Vector3 EnemyPos { get; set; }
|
17
24
|
public Vector3 move;
|
18
25
|
|
19
|
-
void Awake() {
|
20
|
-
|
21
|
-
|
22
|
-
}
|
23
|
-
|
24
26
|
void Start() {
|
25
27
|
m_hp = m_hpMax;
|
26
28
|
this.Player = GameObject.Find("Player1");
|