Walk in VR when looking straight ahead (on y axis)

Hello, I was trying to make my Character controller walk in a straight line and if he/she looks left or right - stop, look up or down - still walk.
I have tried

using UnityEngine;
using System.Collections;

public class VRLookWalkWalking : MonoBehaviour {
    public Transform vrCamera;
    public float toggleAngle = -10.0f;//when you look on X axis at this angle you will walk was 30.0f
    public float speed=3.0f;//speed at which you walk
    public bool moveForward;
    public CharacterController cc;

    // Use this for initialization
    void Start () {
        cc.GetComponent<CharacterController> ();
   
    }
   
    // Update is called once per frame
    void Update () {
        if (vrCamera.localEulerAngles.y>= toggleAngle && vrCamera.localEulerAngles.y < 10.0f) {

        moveForward = true;
        } else {
            moveForward = false;
        }
        if (moveForward) {
            Vector3 forward = vrCamera.TransformDirection (Vector3.forward);
            cc.SimpleMove (forward * speed);
        }
   
    }
}

It did not work. I decided to create a cube in front of the path, make it a trigger. But all the changes to the script above did not work as well. Any help is appreciated. Thank you

are two vectors in the same direction is covered off with Unity - Scripting API: Vector3.Dot

You’d need to know the avatar’s forward vector though

Thank you , Lefty Righty for the answer. I am new to Unity and not sure do I need to create avatar if main camera has Character Controller assigned to it. Any tutorial on how to use Dot.Vector in my case? Thank you