Hello, I have the GvrMain in my projects. Character controller is attached to the camera. When camera looks down between 30and 90 degrees - character moves forward. This script attached to it:
public class VRLookWalk : MonoBehaviour {
public Transform vrCamera;
public float toggleAngle=30.0f;
public float speed = 3.0f;
public bool moveForward;
public CharacterController cc;
// Use this for initialization
void Start () {
cc.GetComponent ();
}
// 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);
}
}
}
All is good, but only when I look up - character lifts from the ground and goes up as well. Any suggestions, please. I am new to Unity.Thank you