質問編集履歴
6
コード修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -78,7 +78,7 @@
|
|
78
78
|
|
79
79
|
{
|
80
80
|
|
81
|
-
|
81
|
+
collider.gameObject.transform.position = new Vector3(3, 1, -13);
|
82
82
|
|
83
83
|
Transform target = GameObject.Find("Cube").transform;
|
84
84
|
|
5
コード修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -64,7 +64,7 @@
|
|
64
64
|
|
65
65
|
//Transform target = GameObject.Find("Cube").transform;
|
66
66
|
|
67
|
-
player.transform.LookAt(target);
|
67
|
+
//player.transform.LookAt(target);
|
68
68
|
|
69
69
|
}
|
70
70
|
|
4
コード修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -62,7 +62,7 @@
|
|
62
62
|
|
63
63
|
player = GameObject.Find("FirstPersonCharacter");
|
64
64
|
|
65
|
-
Transform target = GameObject.Find("Cube").transform;
|
65
|
+
//Transform target = GameObject.Find("Cube").transform;
|
66
66
|
|
67
67
|
player.transform.LookAt(target);
|
68
68
|
|
3
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -48,4 +48,54 @@
|
|
48
48
|
|
49
49
|
```
|
50
50
|
|
51
|
+
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
追記
|
56
|
+
|
57
|
+
```C#
|
58
|
+
|
59
|
+
void Start()
|
60
|
+
|
61
|
+
{
|
62
|
+
|
63
|
+
player = GameObject.Find("FirstPersonCharacter");
|
64
|
+
|
65
|
+
Transform target = GameObject.Find("Cube").transform;
|
66
|
+
|
67
|
+
player.transform.LookAt(target);
|
68
|
+
|
69
|
+
}
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
void OnTriggerEnter(Collider collider)
|
74
|
+
|
75
|
+
{
|
76
|
+
|
77
|
+
if (collider.gameObject.tag == "Player")
|
78
|
+
|
79
|
+
{
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
Transform target = GameObject.Find("Cube").transform;
|
84
|
+
|
85
|
+
//collider.gameObject.transform.LookAt(target);
|
86
|
+
|
87
|
+
player.transform.LookAt(target);
|
88
|
+
|
89
|
+
}
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
```
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
向かせたい方向にCubeを置き、そのCubeを見る方向に向くというようなコードも書いてみましたが、だめでした。
|
98
|
+
|
99
|
+
|
100
|
+
|
51
|
-
アドバイスなどいただけたら幸いです。
|
101
|
+
コードに修正点や他の方法のアドバイスなどいただけたら幸いです。
|
2
test
CHANGED
File without changes
|
test
CHANGED
@@ -47,3 +47,5 @@
|
|
47
47
|
}
|
48
48
|
|
49
49
|
```
|
50
|
+
|
51
|
+
アドバイスなどいただけたら幸いです。
|
1
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|