Player walks in the direction the vr camera is looking?

I want that my player walks in the direction i look in Vr but when i turn my head i want my my character to move to there . so i mean where im looking is forward but i dont get. i tryed it almost a week now and i cant figure it our pls help. i have empty object tagged Player and a child of it is the Camera tagged MainCamera.
the player has an Character Controller.

void Update()
        {
            if (GvrControllerInput.IsTouching)
            {
                ddTouchpadPos = GvrControllerInput.TouchPos;
                if (ddTouchpadPos.y < 0.5f - deadZone)
                {
                    normalizedDDTouch = new Vector3(0, 0, -0.08f);
                }
                if (ddTouchpadPos.y > 0.5f + deadZone)
                {
                    normalizedDDTouch = new Vector3(0, 0, 0.07f);
                }

                if (ddTouchpadPos.x < 0.5f - deadZone)
                {
                    normalizedDDTouch = new Vector3(0.07f, 0, 0);
                }
                if (ddTouchpadPos.x > 0.5f + deadZone)
                {
                    normalizedDDTouch = new Vector3(-0.08f, 0, 0);
                }
                transform.localPosition += normalizedDDTouch;
            }
    }

First of all, add a reference to the camera’s transform :

 public Transform cameraTransform ; // Drag & drop here the transform of the camera rotated by the VR plugin

Then, use the local axies of the camera to move your object

             if (ddTouchpadPos.y < 0.5f - deadZone)
             {
                 normalizedDDTouch = Vector3.ProjectOnPlane( cameraTransform.forward, Vector3.up ) * -0.08f
             }
             if (ddTouchpadPos.y > 0.5f + deadZone)
             {
                 normalizedDDTouch = Vector3.ProjectOnPlane( cameraTransform.forward, Vector3.up ) * 0.07f
             }

             if (ddTouchpadPos.x < 0.5f - deadZone)
             {
                 normalizedDDTouch = cameraTransform.right * 0.07f
             }
             if (ddTouchpadPos.x > 0.5f + deadZone)
             {
                 normalizedDDTouch = cameraTransform.right * -0.08f
             }
             transform.localPosition += normalizedDDTouch;

@Hellium

i just tested it after i build it and there it does not work so only in the editor do you know why?

Edit: i think camera doesnt rotate the empty object so anybody knows how to fix that ?

If it only works in the editor, sometimes this kind of behaviour gets fixed by changing the script order in the project settings. Also, check if there is any float “is equal to/ x == y” (or something close to an is equal to) used to call the script that has to get called.