So in my code below when the user loads into the program they have a canvas GameObject attached to their right hand as a child. It is set inactive in start but it is assigned as a public variable in the editor where it is active when not in play mode. When the user presses the right index trigger for the first time the canvas should be set to active, then there are some things they can interact with that require the canvas to be there, then if they hold the right index trigger for three seconds it should disappear. Right now It doesn’t work so when the user squeezes the right index trigger nothing happens. I feel like I am missing something basic here but I’m just not seeing it. Any help is greatly appreciated.` void Start() {
trackedObj = GetComponent<SteamVR_TrackedObject>();
display.SetActive(false);
}
// Update is called once per frame
void Update() {
if ((SteamController.GetPressDown(gripButton) && grabCount==0 && info == null) || (OVRInput.Get(trigger,OVRInput.Controller.RTouch) == 1 && grabCount==0 && info==null))
{
display.SetActive(true);
grabCount = 1;
Debug.Log("HandPanel Activated");
}
if ((SteamController.GetPressDown(gripButton) && grabCount==1 && info == null) || (OVRInput.Get(trigger, OVRInput.Controller.RTouch) ==1 && grabCount==1 && info != null))
{
info.transform.position = GameObject.Find("HandPanel").transform.position;
info.SetActive(true);
info.transform.rotation = transform.rotation;
info.transform.Rotate(20f, 0f, 0f);
info.transform.parent = transform;
info.transform.localPosition = new Vector3(.02f, .18f, .12f);
WriteText();
}
if ((SteamController.GetPressUp(gripButton) && info == null) || (OVRInput.Get(trigger, OVRInput.Controller.RTouch) == 0 && info != null))
{
info.transform.parent = target.transform;
info.transform.position = target.transform.position;
}
if (gameObject.transform.position.y >=0 || (OVRInput.Get(trigger, OVRInput.Controller.RTouch) ==1 && Time.deltaTime >= buttonTime && info==null) || (SteamController.GetPressDown(gripButton) && Time.deltaTime >= buttonTime && info==null))
{
display.SetActive(false);
grabCount = 0;
Debug.Log("HandPanel Deactivated");
}
}`