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

質問編集履歴

10

2019/11/06 14:55

投稿

Apple_Candy
Apple_Candy

スコア44

title CHANGED
File without changes
body CHANGED
@@ -43,4 +43,5 @@
43
43
 
44
44
  テラインを着いてこさせるのは
45
45
  https://qiita.com/mkgask/items/e332d8576b5cc41ddc7a
46
- を参考にします。
46
+ を参考にします。
47
+ まだしっかりと書いてないので、動作確認していません。

9

2019/11/06 14:54

投稿

Apple_Candy
Apple_Candy

スコア44

title CHANGED
File without changes
body CHANGED
@@ -41,4 +41,6 @@
41
41
  }
42
42
  ```
43
43
 
44
- テラインを着いてこさせるのは
44
+ テラインを着いてこさせるのは
45
+ https://qiita.com/mkgask/items/e332d8576b5cc41ddc7a
46
+ を参考にします。

8

2019/11/06 14:54

投稿

Apple_Candy
Apple_Candy

スコア44

title CHANGED
File without changes
body CHANGED
@@ -7,15 +7,17 @@
7
7
  using System.collections.Generic;
8
8
  using System.collections;
9
9
  using UnityEngine;
10
+ using UnityEngine.UI;
10
11
 
11
12
  public class Airplane : Monobehaviour
12
13
  {
13
14
  Rigidbody rb = this.GetComponent<Rigidbody> ();
14
15
  Vector3 force = new Vector3 (0.0f,0.0f,2.0f);
15
16
  float maxsp = 50.0f;
17
+ Text uitext;
16
18
  void start()
17
19
  {
18
-
20
+ this.uitext = Getconponent<text>();
19
21
  }
20
22
 
21
23
  void update()
@@ -33,6 +35,10 @@
33
35
  {
34
36
  transform.Rotate(new Vector3(0, 0, -8));
35
37
  }
38
+
39
+ this.uitext.text = rb.velocity.magnitude.ToString();
36
40
  }
37
41
  }
38
- ```
42
+ ```
43
+
44
+ テラインを着いてこさせるのは

7

2019/11/06 14:51

投稿

Apple_Candy
Apple_Candy

スコア44

title CHANGED
File without changes
body CHANGED
@@ -12,6 +12,7 @@
12
12
  {
13
13
  Rigidbody rb = this.GetComponent<Rigidbody> ();
14
14
  Vector3 force = new Vector3 (0.0f,0.0f,2.0f);
15
+ float maxsp = 50.0f;
15
16
  void start()
16
17
  {
17
18
 
@@ -21,14 +22,17 @@
21
22
  {
22
23
  if (Input.GetKeyDown(keycode.space)
23
24
  {
24
- if (rb.velocity.magnitude < 10.0f)
25
+ if (rb.velocity.magnitude < maxsp)
25
26
  {
26
27
  rb.Addforce (force);
27
28
  }
28
29
  }else if (Input.GetKeyDown(keycode.rightarrow))
29
- {
30
+ {
30
- transform.Rotate(new Vector3(0, 0, 5));
31
+ transform.Rotate(new Vector3(0, 0, 8));
32
+ }else if (Input.GetKeyDown(keycode.leftarrow))
33
+ {
34
+ transform.Rotate(new Vector3(0, 0, -8));
31
- }
35
+ }
32
36
  }
33
37
  }
34
38
  ```

6

2019/11/06 14:42

投稿

Apple_Candy
Apple_Candy

スコア44

title CHANGED
File without changes
body CHANGED
@@ -19,13 +19,16 @@
19
19
 
20
20
  void update()
21
21
  {
22
- if(Input.GetKeyDown(keycode.space)
22
+ if (Input.GetKeyDown(keycode.space)
23
23
  {
24
24
  if (rb.velocity.magnitude < 10.0f)
25
25
  {
26
26
  rb.Addforce (force);
27
27
  }
28
+ }else if (Input.GetKeyDown(keycode.rightarrow))
29
+ {
30
+ transform.Rotate(new Vector3(0, 0, 5));
28
- }
31
+ }
29
32
  }
30
33
  }
31
34
  ```

5

2019/11/06 14:38

投稿

Apple_Candy
Apple_Candy

スコア44

title CHANGED
File without changes
body CHANGED
@@ -2,6 +2,7 @@
2
2
  解決するにはやはりてラインを大きくするしか方法はないのでしょうか?
3
3
  景色など地面は、同じテクスチャが繰り返されているだけなのでPlayerのtransformからその周辺(その飛行機のobject)だけ描画する又はついて行くみたいなのも考えましたがどうでしょうか。
4
4
 
5
+ 飛行オブジェクト
5
6
  ```C#
6
7
  using System.collections.Generic;
7
8
  using System.collections;
@@ -9,7 +10,8 @@
9
10
 
10
11
  public class Airplane : Monobehaviour
11
12
  {
12
- Rigidbody rb =
13
+ Rigidbody rb = this.GetComponent<Rigidbody> ();
14
+ Vector3 force = new Vector3 (0.0f,0.0f,2.0f);
13
15
  void start()
14
16
  {
15
17
 
@@ -17,7 +19,13 @@
17
19
 
18
20
  void update()
19
21
  {
20
-
22
+ if(Input.GetKeyDown(keycode.space)
23
+ {
24
+ if (rb.velocity.magnitude < 10.0f)
25
+ {
26
+ rb.Addforce (force);
27
+ }
28
+ }
21
29
  }
22
30
  }
23
31
  ```

4

2019/11/06 14:33

投稿

Apple_Candy
Apple_Candy

スコア44

title CHANGED
File without changes
body CHANGED
@@ -2,13 +2,14 @@
2
2
  解決するにはやはりてラインを大きくするしか方法はないのでしょうか?
3
3
  景色など地面は、同じテクスチャが繰り返されているだけなのでPlayerのtransformからその周辺(その飛行機のobject)だけ描画する又はついて行くみたいなのも考えましたがどうでしょうか。
4
4
 
5
- ```オブジェクトC#
5
+ ```C#
6
6
  using System.collections.Generic;
7
7
  using System.collections;
8
8
  using UnityEngine;
9
9
 
10
10
  public class Airplane : Monobehaviour
11
11
  {
12
+ Rigidbody rb =
12
13
  void start()
13
14
  {
14
15
 

3

2019/11/06 14:23

投稿

Apple_Candy
Apple_Candy

スコア44

title CHANGED
File without changes
body CHANGED
@@ -3,5 +3,20 @@
3
3
  景色など地面は、同じテクスチャが繰り返されているだけなのでPlayerのtransformからその周辺(その飛行機のobject)だけ描画する又はついて行くみたいなのも考えましたがどうでしょうか。
4
4
 
5
5
  ```オブジェクトC#
6
+ using System.collections.Generic;
7
+ using System.collections;
8
+ using UnityEngine;
6
9
 
10
+ public class Airplane : Monobehaviour
11
+ {
12
+ void start()
13
+ {
14
+
15
+ }
16
+
17
+ void update()
18
+ {
19
+
20
+ }
21
+ }
7
22
  ```

2

2019/11/06 14:22

投稿

Apple_Candy
Apple_Candy

スコア44

title CHANGED
File without changes
body CHANGED
@@ -2,6 +2,6 @@
2
2
  解決するにはやはりてラインを大きくするしか方法はないのでしょうか?
3
3
  景色など地面は、同じテクスチャが繰り返されているだけなのでPlayerのtransformからその周辺(その飛行機のobject)だけ描画する又はついて行くみたいなのも考えましたがどうでしょうか。
4
4
 
5
+ ```オブジェクトC#
6
+
5
- ```C#
7
+ ```
6
- コード
7
- ```using System.collections;

1

2019/11/06 14:22

投稿

Apple_Candy
Apple_Candy

スコア44

title CHANGED
File without changes
body CHANGED
@@ -1,3 +1,7 @@
1
1
  フライトシュミレーションみたいな高速移動にterainが追いつきません。パソコンも。
2
2
  解決するにはやはりてラインを大きくするしか方法はないのでしょうか?
3
- 景色など地面は、同じテクスチャが繰り返されているだけなのでPlayerのtransformからその周辺(その飛行機のobject)だけ描画する又はついて行くみたいなのも考えましたがどうでしょうか。
3
+ 景色など地面は、同じテクスチャが繰り返されているだけなのでPlayerのtransformからその周辺(その飛行機のobject)だけ描画する又はついて行くみたいなのも考えましたがどうでしょうか。
4
+
5
+ ```C#
6
+ コード
7
+ ```using System.collections;