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

質問編集履歴

3

情報の追加

2020/06/21 15:22

投稿

hukahirame
hukahirame

スコア19

title CHANGED
File without changes
body CHANGED
@@ -33,4 +33,5 @@
33
33
  ### 追記
34
34
  一番下のDebug.Logではすべての値が入っていたので
35
35
  **Instantiate(toshow, toshowpos, Quaternion.identity,c.transform);**
36
- がおかしいと思うのですがわかりませんでした。
36
+ がおかしいと思うのですがわかりませんでした。
37
+ また、Instantiateでnullが返ってくる等ではなく、シーン上に出すこともできない感じでした。

2

コピーミス

2020/06/21 15:22

投稿

hukahirame
hukahirame

スコア19

title CHANGED
File without changes
body CHANGED
@@ -23,7 +23,7 @@
23
23
  RaycastHit2D hit = Physics2D.Raycast(Input.mousePosition, -Vector2.up,0.001f);
24
24
  if (hit.collider.gameObject.tag == "item1")
25
25
  {
26
- toshow = (GameObject)Resources.Load(hit.collider.gameObject.tag + "et");
26
+ toshow = (GameObject)Resources.Load(hit.collider.gameObject.name + "et");
27
27
  Vector3 toshowpos = new Vector3(311, 100);
28
28
  **Instantiate(toshow, toshowpos, Quaternion.identity,c.transform);**
29
29
  Debug.Log(toshowpos);

1

コピーミス

2020/06/21 15:20

投稿

hukahirame
hukahirame

スコア19

title CHANGED
File without changes
body CHANGED
@@ -23,7 +23,7 @@
23
23
  RaycastHit2D hit = Physics2D.Raycast(Input.mousePosition, -Vector2.up,0.001f);
24
24
  if (hit.collider.gameObject.tag == "item1")
25
25
  {
26
- toshow = (GameObject)Resources.Load(hogehoge + "et");
26
+ toshow = (GameObject)Resources.Load(hit.collider.gameObject.tag + "et");
27
27
  Vector3 toshowpos = new Vector3(311, 100);
28
28
  **Instantiate(toshow, toshowpos, Quaternion.identity,c.transform);**
29
29
  Debug.Log(toshowpos);