Home Forums Software Development [Solved] GazeAwareComponent not being received when close to character

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #4002

    Hey guys,

    I’ve been experiencing lots of frustration recently trying to figure this part out: I’m creating a game where I have to start a conversation by walking close to a character and then gazing at the character. So, if I’m close enough to the character and look at the character then the conversation automatically starts.

    I’m using Unity 5.0.0f4.

    I outputted values from the Debug Log and I’m getting values saying that I am gazing at the character from far away, but when I get closer and pass a certain point (I think it has to do with the box/capsule collider) then it doesn’t receive my gaze for some reason.

    My one class on the NPC character to be gazed at basically just contains the code:

    private GazeAwareComponent _gazeAware;

    public bool IsGazedAt {get; private set;}

    void start() {
    _gazeAware = GetComponent<GazeAwareComponent>();

    void Update() {
    IsGazedAt = _gazeAware.HasGaze;

    And then, on my player GameObject, I have a class that gets a reference to that gameobject for the NPC and checks the IsGazedAt variable.

    Basically, I get the right value when I’m far away from the NPC but then when I walk closer it doesn’t receive my gaze for some reason for GazeAwareComponent.
    I do get the Usable though when I get closer, since I have a selecter to get the usable in range so that I can send an OnUse message to it to start the conversation. But, when I get the usable I don’t get the gazeAwareComponent. They are opposites.

    Again, I hypothesize that it’s something to do with box/capsule colliders but I’m not 100% sure.

    Any help would be greatly appreciated. Thanks a lot!

    Jenny [Tobii]

    Hi Joe (@joeval),

    On the GazeAwareComponent, there is an option for “Show Projected Bounds”. Enable that to get a visual representation how the NPC character is projected to Screen space by default by the EyeX Framework for Unity. This might give you some better idea what goes wrong.

    It is hard for us to create a good-enough default implementation in the EyeX Framework for using EyeX interactions like GazeAware since we do not have access to source integration with the Unity Engine itself. So the implementation we have is quite crude and does not scale well performance vice. But also, there is not much flexibility given with the current EyeX components, with no options to customize them in the Unity Editor. Right now, the only option for a developer like yourself to get control over the world-to-screen projection used by EyeX is to customize the component in code, by inheriting from the GazeAwareComponent class and overriding one of the following methods: GetProjectedBounds() or GetRenderer(). These methods are implemented in the GazeAwareComponent’s parent class EyeXGameObjectInteractorBase.

    By default, the algorithm to calculate the projected bounds of a game object with an attached EyeX Behavior component works like this:

    1. Try to define an axis-aligned bounding box in World space for the game object:
    1.1) Use the game object’s BoxCollider as bounding box. Go to 2.
    1.2) If no BoxCollider, use bounding box of the game object’s Renderer. Go to 2.
    1.3) If no Renderer on the game object itself, use the Renderer of one of its children. Go to 2.
    1.4) None of the above worked. Exit the projection calculation with an exception.
    2. Given an axis-aligned bounding box, project its corner points to the Screen and find an axis-aligned rectangle in Screen space that fits all of the projected corner points.

    I hope to be able to provide better customizable EyeX components in the next EyeX SDK for Unity release. But there is much more focus internally on creating code samples on how to use the EyeX data streams to create the kind of eye-tracking interactions implemented in Assassin’s Creed, the Hunter and such games.


    Hi Jenny,

    Thank you so much for your reply! I really appreciate it! I see. I tried what you suggested and I was able to get it to work finally haha. Thanks again!

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