質問編集履歴
1
修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -5,9 +5,30 @@
|
|
5
5
|
|
6
6
|
|
7
7
|
### 該当のソースコード
|
8
|
+
public Animator animator;
|
9
|
+
public GameObject Enemybody;
|
10
|
+
void VoidEnemyAttack ()
|
11
|
+
{
|
8
|
-
|
12
|
+
animator10.SetBool("attack", true);
|
13
|
+
}
|
14
|
+
|
15
|
+
public void Generation() {
|
16
|
+
|
17
|
+
var parent = this.transform;
|
18
|
+
Instantiate(Enemybody, new Vector3(Enemy.transform.position.x, 0.5f, 0f), Quaternion.identity, parent).GetComponent<Animator>();
|
19
|
+
this.transform.Rotate(0.0f, -90.0f, 2.0f);
|
20
|
+
}
|
21
|
+
|
22
|
+
|
9
23
|
```ここに言語名を入力
|
10
24
|
C#
|
11
25
|
|
12
26
|
### 試したこと
|
13
|
-
生成する前のAssetを親のスクリプトに貼り付けてみました。
|
27
|
+
生成する前のAssetを親のスクリプトに貼り付けてみました。
|
28
|
+
|
29
|
+
ヒエラルキー構造
|
30
|
+
親がEnemyでその子にEnemyのGameObjectにプロジェクトから貼り付けたものをInstantiateしました。
|
31
|
+
|
32
|
+
親のanimatorにはControllerとアバターも取得出来ておりません。
|
33
|
+
|
34
|
+
エラーは出ておりません。
|