質問編集履歴

10

2019/11/06 14:55

投稿

Apple_Candy
Apple_Candy

スコア43

test CHANGED
File without changes
test CHANGED
@@ -89,3 +89,5 @@
89
89
  https://qiita.com/mkgask/items/e332d8576b5cc41ddc7a
90
90
 
91
91
  を参考にします。
92
+
93
+ まだしっかりと書いてないので、動作確認していません。

9

2019/11/06 14:54

投稿

Apple_Candy
Apple_Candy

スコア43

test CHANGED
File without changes
test CHANGED
@@ -85,3 +85,7 @@
85
85
 
86
86
 
87
87
  テラインを着いてこさせるのは
88
+
89
+ https://qiita.com/mkgask/items/e332d8576b5cc41ddc7a
90
+
91
+ を参考にします。

8

2019/11/06 14:54

投稿

Apple_Candy
Apple_Candy

スコア43

test CHANGED
File without changes
test CHANGED
@@ -16,6 +16,8 @@
16
16
 
17
17
  using UnityEngine;
18
18
 
19
+ using UnityEngine.UI;
20
+
19
21
 
20
22
 
21
23
  public class Airplane : Monobehaviour
@@ -28,11 +30,13 @@
28
30
 
29
31
  float maxsp = 50.0f;
30
32
 
33
+ Text uitext;
34
+
31
35
  void start()
32
36
 
33
37
  {
34
38
 
35
-
39
+ this.uitext = Getconponent<text>();
36
40
 
37
41
  }
38
42
 
@@ -68,8 +72,16 @@
68
72
 
69
73
  }
70
74
 
75
+
76
+
77
+ this.uitext.text = rb.velocity.magnitude.ToString();
78
+
71
79
  }
72
80
 
73
81
  }
74
82
 
75
83
  ```
84
+
85
+
86
+
87
+ テラインを着いてこさせるのは

7

2019/11/06 14:51

投稿

Apple_Candy
Apple_Candy

スコア43

test CHANGED
File without changes
test CHANGED
@@ -26,6 +26,8 @@
26
26
 
27
27
  Vector3 force = new Vector3 (0.0f,0.0f,2.0f);
28
28
 
29
+ float maxsp = 50.0f;
30
+
29
31
  void start()
30
32
 
31
33
  {
@@ -44,7 +46,7 @@
44
46
 
45
47
  {
46
48
 
47
- if (rb.velocity.magnitude < 10.0f)
49
+ if (rb.velocity.magnitude < maxsp)
48
50
 
49
51
  {
50
52
 
@@ -54,11 +56,17 @@
54
56
 
55
57
  }else if (Input.GetKeyDown(keycode.rightarrow))
56
58
 
57
- {
59
+ {
58
60
 
59
- transform.Rotate(new Vector3(0, 0, 5));
61
+ transform.Rotate(new Vector3(0, 0, 8));
60
62
 
63
+ }else if (Input.GetKeyDown(keycode.leftarrow))
64
+
65
+ {
66
+
67
+ transform.Rotate(new Vector3(0, 0, -8));
68
+
61
- }
69
+ }
62
70
 
63
71
  }
64
72
 

6

2019/11/06 14:42

投稿

Apple_Candy
Apple_Candy

スコア43

test CHANGED
File without changes
test CHANGED
@@ -40,7 +40,7 @@
40
40
 
41
41
  {
42
42
 
43
- if(Input.GetKeyDown(keycode.space)
43
+ if (Input.GetKeyDown(keycode.space)
44
44
 
45
45
  {
46
46
 
@@ -52,7 +52,13 @@
52
52
 
53
53
  }
54
54
 
55
+ }else if (Input.GetKeyDown(keycode.rightarrow))
56
+
57
+ {
58
+
59
+ transform.Rotate(new Vector3(0, 0, 5));
60
+
55
- }
61
+ }
56
62
 
57
63
  }
58
64
 

5

2019/11/06 14:38

投稿

Apple_Candy
Apple_Candy

スコア43

test CHANGED
File without changes
test CHANGED
@@ -5,6 +5,8 @@
5
5
  景色など地面は、同じテクスチャが繰り返されているだけなのでPlayerのtransformからその周辺(その飛行機のobject)だけ描画する又はついて行くみたいなのも考えましたがどうでしょうか。
6
6
 
7
7
 
8
+
9
+ 飛行オブジェクト
8
10
 
9
11
  ```C#
10
12
 
@@ -20,7 +22,9 @@
20
22
 
21
23
  {
22
24
 
23
- Rigidbody rb =
25
+ Rigidbody rb = this.GetComponent<Rigidbody> ();
26
+
27
+ Vector3 force = new Vector3 (0.0f,0.0f,2.0f);
24
28
 
25
29
  void start()
26
30
 
@@ -36,7 +40,19 @@
36
40
 
37
41
  {
38
42
 
39
-
43
+ if(Input.GetKeyDown(keycode.space)
44
+
45
+ {
46
+
47
+ if (rb.velocity.magnitude < 10.0f)
48
+
49
+ {
50
+
51
+ rb.Addforce (force);
52
+
53
+ }
54
+
55
+ }
40
56
 
41
57
  }
42
58
 

4

2019/11/06 14:33

投稿

Apple_Candy
Apple_Candy

スコア43

test CHANGED
File without changes
test CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
 
8
8
 
9
- ```オブジェクトC#
9
+ ```C#
10
10
 
11
11
  using System.collections.Generic;
12
12
 
@@ -19,6 +19,8 @@
19
19
  public class Airplane : Monobehaviour
20
20
 
21
21
  {
22
+
23
+ Rigidbody rb =
22
24
 
23
25
  void start()
24
26
 

3

2019/11/06 14:23

投稿

Apple_Candy
Apple_Candy

スコア43

test CHANGED
File without changes
test CHANGED
@@ -8,6 +8,36 @@
8
8
 
9
9
  ```オブジェクトC#
10
10
 
11
+ using System.collections.Generic;
12
+
13
+ using System.collections;
14
+
15
+ using UnityEngine;
11
16
 
12
17
 
18
+
19
+ public class Airplane : Monobehaviour
20
+
21
+ {
22
+
23
+ void start()
24
+
25
+ {
26
+
27
+
28
+
29
+ }
30
+
31
+
32
+
33
+ void update()
34
+
35
+ {
36
+
37
+
38
+
39
+ }
40
+
41
+ }
42
+
13
43
  ```

2

2019/11/06 14:22

投稿

Apple_Candy
Apple_Candy

スコア43

test CHANGED
File without changes
test CHANGED
@@ -6,8 +6,8 @@
6
6
 
7
7
 
8
8
 
9
- ```C#
9
+ ```オブジェクトC#
10
10
 
11
- コード
12
11
 
12
+
13
- ```using System.collections;
13
+ ```

1

2019/11/06 14:22

投稿

Apple_Candy
Apple_Candy

スコア43

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