Get location of gameobject Camera Rig?

I am having trouble finding the location of a gameobject. I am working in 5.4. Can anyone help? I have it so I have the VR Headset set as the MainCameraRig and now just trying to find the location, so that when the headsets location hovers over a panel, I want the panel to change color. Can anyone help? Code is below… using UnityEngine;
using System.Collections;

public class stance : MonoBehaviour {

private SteamVR_TrackedController controller;
//private GameController headset;
private GameObject headset;

// Use this for initialization
void Start () {
    headset = GameObject.Find("[CameraRig]");

}

// Update is called once per frame
void Update () {

   
}

void changecolor()
{
    headset.transform.Rotate(0, 100 * Time.deltaTime, 0);
    if (this.headset ==)
    {

    }
}

}

If you’re just looking for the position of a GameObject in world space you would use the Transform component to get it like this:

headset.transform.position

That gives you a Vector3 and you can compare that to another position with Vector3.Distance

Looking at the xyz values of [CameraRig] I noticed they stay at 0, 0, 0. I think you’ll need to use Camera (eye) instead.

The following script creates a think but tall block that follows the headset on the x and z axis.

using System.Collections;a
using System.Collections.Generic;
using UnityEngine;

public class StayAtPlayer : MonoBehaviour {

	private GameObject headset;
	private GameObject cube;
	void Start () {
		headset = GameObject.Find("Camera (eye)");
		cube = GameObject.CreatePrimitive (PrimitiveType.Cube);
		cube.transform.localScale = new Vector3 (0.1f, 2.0f, 0.1f);
	}
	
	void Update () {
		cube.transform.position = new Vector3 (headset.transform.position.x, 1.0f, headset.transform.position.z);
	}
}