回答編集履歴

3

a

2018/12/02 14:44

投稿

flan
flan

スコア146

test CHANGED
@@ -4,25 +4,9 @@
4
4
 
5
5
  ```ここに言語を入力
6
6
 
7
- public rootRotationObject ; ←回転させているオブジェクトの一番上のルートをアタッチ
7
+ public Transform rootRotationObject ; ←回転させているオブジェクトの一番上のルートをアタッチ
8
-
9
- private Transform tr;
10
8
 
11
9
 
12
-
13
-
14
-
15
- void Start()
16
-
17
- {
18
-
19
-
20
-
21
- tr=rootRotationObject.GetComponent<TransForm>();
22
-
23
-
24
-
25
- }
26
10
 
27
11
 
28
12
 
@@ -34,7 +18,7 @@
34
18
 
35
19
      //重力の向きを変更
36
20
 
37
- Physics.gravity = tr.up*(-9.8f);
21
+ Physics.gravity = rootRotationObject.up*(-9.8f);
38
22
 
39
23
  }
40
24
 

2

a

2018/12/02 14:44

投稿

flan
flan

スコア146

test CHANGED
@@ -10,6 +10,8 @@
10
10
 
11
11
 
12
12
 
13
+
14
+
13
15
  void Start()
14
16
 
15
17
  {
@@ -17,6 +19,8 @@
17
19
 
18
20
 
19
21
  tr=rootRotationObject.GetComponent<TransForm>();
22
+
23
+
20
24
 
21
25
  }
22
26
 
@@ -26,9 +30,11 @@
26
30
 
27
31
  {
28
32
 
33
+
34
+
29
35
      //重力の向きを変更
30
36
 
31
- Physics2D.gravity = tr.up*(-9.8f);
37
+ Physics.gravity = tr.up*(-9.8f);
32
38
 
33
39
  }
34
40
 

1

うーn

2018/12/02 11:18

投稿

flan
flan

スコア146

test CHANGED
@@ -1,6 +1,6 @@
1
1
  ニコ生?
2
2
 
3
-
3
+ 試してないです。正常に動くかは謎
4
4
 
5
5
  ```ここに言語を入力
6
6