回答編集履歴

1

修正すべき点をわかりやすくしました

2019/11/22 05:20

投稿

tor4kichi
tor4kichi

スコア763

test CHANGED
@@ -4,6 +4,36 @@
4
4
 
5
5
  ```csharp
6
6
 
7
+
8
+
9
+ // Start is called before the first frame update
10
+
11
+ void Start()
12
+
13
+ {
14
+
15
+ // playerオブジェクトを取得
16
+
17
+ this.Player = GameObject.Find("Player");
18
+
19
+ GetComponent<Rigidbody2D>().velocity
20
+
21
+ = new Vector2(0, speed);
22
+
23
+
24
+
25
+ Destroy(gameObject, 3.0f);
26
+
27
+
28
+
29
+ // ❌
30
+
31
+ // Vector3 PlayerPos = this.Player.transform.position;
32
+
33
+ // ⭕
34
+
7
- this.PlayerPos = this.Player.transform.position;
35
+ PlayerPos = this.Player.transform.position;
36
+
37
+ }
8
38
 
9
39
  ```