teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

3

a

2018/12/02 14:44

投稿

flan
flan

スコア146

answer CHANGED
@@ -1,22 +1,14 @@
1
1
  ニコ生?
2
2
  試してないです。正常に動くかは謎
3
3
  ```ここに言語を入力
4
- public rootRotationObject ; ←回転させているオブジェクトの一番上のルートをアタッチ
4
+ public Transform rootRotationObject ; ←回転させているオブジェクトの一番上のルートをアタッチ
5
- private Transform tr;
6
5
 
7
6
 
8
- void Start()
9
- {
10
-
11
- tr=rootRotationObject.GetComponent<TransForm>();
12
-
13
- }
14
-
15
7
  void Update()
16
8
  {
17
9
 
18
10
      //重力の向きを変更
19
- Physics.gravity = tr.up*(-9.8f);
11
+ Physics.gravity = rootRotationObject.up*(-9.8f);
20
12
  }
21
13
 
22
14
 

2

a

2018/12/02 14:44

投稿

flan
flan

スコア146

answer CHANGED
@@ -4,16 +4,19 @@
4
4
  public rootRotationObject ; ←回転させているオブジェクトの一番上のルートをアタッチ
5
5
  private Transform tr;
6
6
 
7
+
7
8
  void Start()
8
9
  {
9
10
 
10
11
  tr=rootRotationObject.GetComponent<TransForm>();
12
+
11
13
  }
12
14
 
13
15
  void Update()
14
16
  {
17
+
15
18
      //重力の向きを変更
16
- Physics2D.gravity = tr.up*(-9.8f);
19
+ Physics.gravity = tr.up*(-9.8f);
17
20
  }
18
21
 
19
22
 

1

うーn

2018/12/02 11:18

投稿

flan
flan

スコア146

answer CHANGED
@@ -1,5 +1,5 @@
1
1
  ニコ生?
2
-
2
+ 試してないです。正常に動くかは謎
3
3
  ```ここに言語を入力
4
4
  public rootRotationObject ; ←回転させているオブジェクトの一番上のルートをアタッチ
5
5
  private Transform tr;