Home Forums Community Projects Tobii and Unity

Tagged: 

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #3680
    Audrey Gillies
    Participant

    Hi all 🙂

    I’m looking for some help. I’ve created a button in unity that highlights on mouseover by slightly increasing in size using an animator controller. I’d like to do the same using gaze. I’ve set the button to be gaze aware, but when I try and set up the second script that tells it what to do (like the SpinOnGaze in the intro project) it doesn’t work…and I’ve no idea why. I’ve asked the same question in the Unity forum but thought I’d post here in case anyone had encountered the same issue. Here is my code for the button behaviour :

    using UnityEngine;
    using System.Collections;
    
    public class Focus : MonoBehaviour
    
    {
        Animator anim = Button1;
        private GazeAwareComponent _gazeAware;
    
        void Start()
        {
            
            _gazeAware = GetComponent<GazeAwareComponent>();
        }
    
        void Update()
        {
            if (_gazeAware.HasGaze)
    
            {
                // Get the Animator component from your gameObject 
    
                Animator anim = GetComponent<Animator>();
    
            }
        }
    }
    
    #3896

    Did you ever receive a answer for this? I was having a similar issue trying to use GUI buttons but decided to go another route. Are you using 3d objects with colliders or meshes? The gaze aware component needs one or the other. I had been suggested to override the default class for GUI buttons but I have yet to try it so I’m not sure of is efficacy.

    #3916
    Jenny [Tobii]
    Participant

    Hi,

    My best try to help was posted in this related topic:

    Tobii Unity Error Message

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.