質問編集履歴

1

当該スクリプトのクラス名を追記。他スクリプトを追記。

2019/05/08 09:29

投稿

SugKim
SugKim

スコア10

test CHANGED
File without changes
test CHANGED
@@ -11,6 +11,10 @@
11
11
  ##Script
12
12
 
13
13
  ```C#
14
+
15
+ public class BarObstScript : MonoBehaviour
16
+
17
+ {
14
18
 
15
19
  public float bar_speed;
16
20
 
@@ -56,7 +60,61 @@
56
60
 
57
61
  }
58
62
 
63
+ }
64
+
59
65
  ```
66
+
67
+
68
+
69
+ ##Script2
70
+
71
+ 原因がありそうな他のスクリプトは下記ぐらいです。
72
+
73
+ こちらはプレハブ化したbarオブジェクトを一定間隔で生成しようとしてます。
74
+
75
+ ```C#
76
+
77
+ public class BarObstReplicScript : MonoBehaviour
78
+
79
+ {
80
+
81
+ public GameObject BarObst;
82
+
83
+
84
+
85
+ void Start()
86
+
87
+ {
88
+
89
+ InvokeRepeating("SpawnBar", 0f, 1.4f);
90
+
91
+ }
92
+
93
+
94
+
95
+ void Update()
96
+
97
+ {
98
+
99
+
100
+
101
+ }
102
+
103
+
104
+
105
+ void SpawnBar()
106
+
107
+ {
108
+
109
+ Instantiate(BarObst, new Vector3(transform.position.x, transform.position.y, transform.position.z), transform.rotation);
110
+
111
+ }
112
+
113
+ }
114
+
115
+ ```
116
+
117
+
60
118
 
61
119
  ###開発環境
62
120