Search Unity

OVR Gaze Event Trigger not triggering script events

Discussion in 'AR/VR (XR) Discussion' started by Nesquil, Nov 2, 2018.

  1. Nesquil

    Nesquil

    Joined:
    Oct 23, 2018
    Posts:
    4
    Hello,
    I am new to developing for Oculus. I have a canvas with a menu button. I have attached the Over Gaze Event Trigger to it. I set up the script to run my functions from my VRButton scripts, which changes the BackgroundImage color. However, when I run the program and use transform to move my Gaze Pointer Ring over the MenuButton and I click on the game scene, nothing happens. Please help, I have been going over this tutorial and I can't find any difference between mine and his.


    Here is a zip of my project. If there is a better way of sharing it, let me know.
    https://drive.google.com/file/d/1bEbAQxdoAe5q6oFLlJZihrKZZGreDt65/view?usp=sharing

    This is my VRButton script.
    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using UnityEngine.UI;
    5.  
    6. public class VRButton : MonoBehaviour {
    7.  
    8.     public Image BackgroundImage;
    9.     public Color NormalColor;
    10.     public Color HighlightColor;
    11.  
    12.     // Use this for initialization
    13.     void Start () {
    14.        
    15.     }
    16.    
    17.     // Update is called once per frame
    18.     void Update () {
    19.        
    20.     }
    21.  
    22.     public void OnGazeEnter()
    23.     {
    24.         BackgroundImage.color = HighlightColor;
    25.     }
    26.  
    27.     public void onGazeExit()
    28.     {
    29.         BackgroundImage.color = NormalColor;
    30.     }
    31. }
    32.