Home › Forums › Community Projects › Tobii and Unity
Tagged: Unity
- This topic has 2 replies, 3 voices, and was last updated 8 years, 9 months ago by Jenny [Tobii].
- AuthorPosts
- 30/10/2015 at 15:56 #3680Audrey GilliesParticipant
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>(); } } }
12/12/2015 at 06:34 #3896Richard Ray WellmanParticipantDid 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.
14/12/2015 at 18:24 #3916Jenny [Tobii]Participant - AuthorPosts
- You must be logged in to reply to this topic.