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

回答編集履歴

4

追記に対する回答の追加

2021/03/28 09:19

投稿

coolwind0202
coolwind0202

スコア708

answer CHANGED
@@ -22,4 +22,13 @@
22
22
  GetComponent<Rigidbody>().AddForce(dir);
23
23
  ```
24
24
 
25
- に変更してみてはどうですか?
25
+ に変更してみてはどうですか?
26
+
27
+ (追記)
28
+ ```cs
29
+ GetComponent<Rigibody>().isKinematic = true;
30
+
31
+ GetComponent<Rigidbody>().isKinematic = true;
32
+ ```
33
+
34
+ RigidbodyがRigibodyになっています

3

fix

2021/03/28 09:19

投稿

coolwind0202
coolwind0202

スコア708

answer CHANGED
@@ -19,7 +19,7 @@
19
19
  ```cs
20
20
  GetComponet<Rigidbody>().AddForce(dir);
21
21
 
22
- GetComponent<Rigibody>().AddForce(dir);
22
+ GetComponent<Rigidbody>().AddForce(dir);
23
23
  ```
24
24
 
25
25
  に変更してみてはどうですか?

2

追記しました

2021/03/28 04:13

投稿

coolwind0202
coolwind0202

スコア708

answer CHANGED
@@ -1,3 +1,11 @@
1
+ ① NullReferenceException
2
+
3
+ Unityを再起動してみてください。
4
+
5
+ [参考:https://raspberly.hateblo.jp/entry/UIElementsError](https://raspberly.hateblo.jp/entry/UIElementsError)
6
+
7
+ ⑤ `A namespace cannot directly contain members such as fields or methods`
8
+
1
9
  `IgaguriGenerator` 内
2
10
 
3
11
  ```cs

1

脱字の指摘

2021/03/28 03:50

投稿

coolwind0202
coolwind0202

スコア708

answer CHANGED
@@ -1,13 +1,17 @@
1
- `IgaguriGenerator` プログラムのクラス名が
1
+ `IgaguriGenerator` 内
2
2
 
3
3
  ```cs
4
4
  public class NewBehaviourScript : MonoBehaviour
5
+
6
+ public class IgaguriGenerator : MonoBehaviour
5
7
  ```
6
8
 
7
- になっているので、
9
+ `IgaguriController` 内
8
10
 
9
11
  ```cs
12
+ GetComponet<Rigidbody>().AddForce(dir);
13
+
10
- public class IgaguriGenerator : MonoBehaviour
14
+ GetComponent<Rigibody>().AddForce(dir);
11
15
  ```
12
16
 
13
17
  に変更してみてはどうですか?