質問編集履歴

2

コードの追加

2021/08/30 02:41

投稿

Akimotoyuyu_Awe
Akimotoyuyu_Awe

スコア0

test CHANGED
File without changes
test CHANGED
@@ -24,7 +24,63 @@
24
24
 
25
25
  ### 該当のソースコード
26
26
 
27
+ using System.Collections;
27
28
 
29
+ using System.Collections.Generic;
30
+
31
+ using UnityEngine;
32
+
33
+
34
+
35
+ public class Move : MonoBehaviour
36
+
37
+ {
38
+
39
+ GameObject Myball;
40
+
41
+ GameObject Enemy;
42
+
43
+
44
+
45
+ // Use this for initialization
46
+
47
+ void Start()
48
+
49
+ {
50
+
51
+ this.pos1 = GameObject.Find("Myball");
52
+
53
+ this.pos2 = GameObject.Find("Enemy");
54
+
55
+ }
56
+
57
+
58
+
59
+ this.pos1Z = this.pos1.transform.position.z;
60
+
61
+ this.pos2X = this.pos2.transform.position.x;
62
+
63
+ // Update is called once per frame
64
+
65
+ void Update()
66
+
67
+ {
68
+
69
+ if (pos2X>-10)
70
+
71
+ {
72
+
73
+ tratnsform.Translate(0.1f, 0f, 0f);
74
+
75
+ }
76
+
77
+
78
+
79
+ }
80
+
81
+
82
+
83
+ }
28
84
 
29
85
  ```ここに言語名を入力
30
86
 

1

Unityの追加

2021/08/30 02:41

投稿

Akimotoyuyu_Awe
Akimotoyuyu_Awe

スコア0

test CHANGED
File without changes
test CHANGED
File without changes