How do I customize a FPS Controller Script to work with Google VR?

Hi, I’m a noob with no coding experience, but I’m trying to customize the Standard Assets “First Person Controller Script” for a Google VR project.

I managed to get the Player to move in the direction of the Camera by using this method.

Vector3 desiredMove = GvrViewerMain.transform.forwardm_Input.y + GvrViewerMain.transform.rightm_Input.x;

The issue I’m having now it that the Raycast is not working.
I need to send a raycast from the center of the Camera or (GvrViewerMain)

Iv’e tried this…

        Ray pointer = new Ray(GvrViewerMain.transform.localPosition, Vector3.forward);
		RaycastHit hitInfo;

But no luck… How should I go about this??
Any help is greatly appreciated! Thanks

With VR theirs 2 cameras so you ether have to pick one sorta like you did there or you can have the raycast spawn from a gameobject like the gun in your hand or something else. Heres what it would look like for your thing.

         public Transform gunBarrel;
         
         Ray pointer = new Ray(gunBarrel.position, gunBarrel.forward);
         RaycastHit hitInfo; 

I would also put a Debug.log in it to tell you what the raycast is hitting

Debug.Log(hitInfo.collider.gameobject.name);