- Home /
Question by
vanestorming · Sep 18, 2018 at 12:27 AM ·
androidvrlook at
VR Camera on the floor
Hello, I'm having an issue with my first project in Unity. It's about an architectural design, and the VR action is used to walk through the house. For this reason, I have used an look walk script >
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class VRLookWalk : MonoBehaviour
{
public Transform vrCamera;
public float toggleAngle = 30.0f;
public float speed = 3.0f;
public bool moveForward;
private CharacterController cc;
// Use this for initialization
void Start()
{
cc = GetComponent<CharacterController>();
}
// Update is called once per frame
void Update()
{
if (vrCamera.eulerAngles.x >= toggleAngle && vrCamera.eulerAngles.x < 90.0f)
{
moveForward = true;
}
else
{
moveForward = false;
}
if (moveForward )
{
Vector3 forward = vrCamera.TransformDirection(Vector3.forward);
cc.SimpleMove(forward * speed);
}
}
}
Everything is fine at the beginning, but when you need to advance, the camera is closer to the floor and you see everything from this view. I would like to see things in an human view. Could you provide me suggestions to try to fix it? Thanks in advance!
img-20180917-201703106.png
(409.8 kB)
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612174823im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How to open a url in VR Browser from a Gear VR app? 1 Answer
Zenfone 2 and Unity Native VR 2 Answers
Android PicoVR EGL_BAD_SURFACE Error? 0 Answers
Connect OVRGearVrController to Scene 0 Answers
Unable to Build my Gear VR app 0 Answers