Look and walk in VR unity 5.6.6

Hi. I’m using unity 5.6 and googleVR 1.0v. This is script written below, i want to move forward when i look down while player rotation.x is greater than or equal to 30f and less than 90f.
When i look down and rotation.x goes to greater than 30f, my player is start moving down instead of moving forward.
I created an empty object and make it the parent of main Camera. This script is attached to the main camera and character controller is on the parent GameObject.

public Transform VR;

public float toggleAngle = 30f;
public float speed = 3.0f;
public bool moveForword;
public CharacterController cc;

void Start()
{
	cc = GetComponentInParent<CharacterController> ();
}
void Update()
{
	if (VR.eulerAngles.x > toggleAngle && VR.eulerAngles.x < 90f) {
		moveForword = true;
	} else
		moveForword = false;

	if (moveForword) {
		Vector3 move = VR.TransformDirection (Vector3.forward);
		cc.SimpleMove (move * speed);
	}
}

Try making a reference to the character controller in update instead of just at start. so cc = GetComponentInParent<CharacterController>(); should be in update not start (according to the API documentation).

Also check line 17. I don’t think it’s giving you the forward vector you want. if “VR” is your empty parent object, then using its forward would always give the same direction since it is the camera that would be rotating. maybe Vector3 move = gameObject.TransformDirection(Vector3.forward).