1
には移動しない私は、ゲームにGVRカムを移動する必要がありますが、Androidアプリでそれが動かない... :私のプレイヤーが自分のGVRアプリケーション
public class controller : MonoBehaviour {
private bool walking = false;
private Vector3 spawnPoint;
void Start() {
spawnPoint = transform.position;
}
void Update() {
if (walking)
{
transform.position = transform.position + Camera.main.transform.forward * 3 * Time.deltaTime;
}
if (transform.position.y <-10f)
{
transform.position = spawnPoint;
}
Ray ray = Camera.main.ViewportPointToRay(new Vector3(.5f, .5f, 0));
RaycastHit hit;
if (Physics.Raycast (ray, out hit))
{
if (hit.collider.name.Contains("plane"))
{
walking = false;
} else
{
walking = true;
}
}
}
を
In the image linked here there is my plane