Home Forums Software Development Unity3d 4.6 Cannot find Camera object

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • #3246
    David Froy

    Hi I am using unity 4.6 for a project and I am using the lastest 1.5 SDK. I am getting a NULLReferenceException with the camera object.

    NullReferenceException: Object reference not set to an instance of an object
    ProjectedRect.GetProjectedRect (IEnumerable`1 boundingCornerPoints, UnityEngine.Camera camera, Boolean allowOverlap) (at Assets/Standard Assets/EyeXFramework/ProjectedRect.cs:67)
    ProjectedRect.GetProjectedRect (Bounds bounds, UnityEngine.Camera camera, Boolean allowOverlap) (at Assets/Standard Assets/EyeXFramework/ProjectedRect.cs:38)
    EyeXGameObjectInteractorBase.GetProjectedRect () (at Assets/Standard Assets/EyeXFramework/EyeXGameObjectInteractorBase.cs:106)
    EyeXGameObjectInteractorBase.UpdateInteractorLocation (.EyeXInteractor interactor) (at Assets/Standard Assets/EyeXFramework/EyeXGameObjectInteractorBase.cs:111)
    EyeXGameObjectInteractorBase.OnEnable () (at Assets/Standard Assets/EyeXFramework/EyeXGameObjectInteractorBase.cs:60)

    I was wondering if there is an issue with 4.6 with the 1.5 SDK for if there is something I am missing. Where is the camera found in the SDK? I have it working with version 5 of unity, but we have an older 4.6 project I want to test with. Thanks for any help.

    Patrik [Tobii]

    Hello David,

    It’s impossible to say what might be wrong without seeing the project, but it look like you don’t have a camera attached to your scene.

    Best regards


    I am having the same issue. Although I KNOW for a fact that there is a camera in the scene. I did the sample project that was suggested here on the site, to get a cube spinning, and it worked fine. As a matter of fact, I was able to get many objects spinning by gaze aware. I was even able to get the objects moving, etc. using gaze aware (great function btw).

    The issue I’m having in my game is that since my camera is rotated downward 90 degrees from origin, it seems like the gaze aware is trying to look in the ‘X’ direction but is unable to do so because the camera is facing downward in the ‘Y’ direction. Is there anyway to override this? The code for the EyeX Gaze Aware is a bit beyond me so any direction would be appreciated. I am assuming the ‘X’ Face of the cube is trying to acquire gaze aware and is not capable due to the angle of the camera.

    BTW as a scientific check, I rotated the camera in the sample project and got literally the same issues in my console there as I did in my own project.

    Jenny [Tobii]

    Hi Richard,

    Hm, yes I think this must have to do with how the EyeX Framework code tries to project the bounding box of the game object from World space to Screen.

    If you want to take a look, and hack away to try and make it work for you, the projection calculation code is implemented as static methods on UnityProject\Assets\Standard Assets\EyeXFramework\ProjectedRect.cs.

    It basically works like this:
    0. Given either a Bounds object or a BoxCollider object corresponding to a bounding box containing the game object
    1. Find the 8 corner points of the axis-aligned box
    2. Project the corner points from World to Screen
    3. Calculate the smallest axis-aligned rectangle on Screen that contains all of the corner points.

    It is also possible to override the GetProjectedRect() method by creating your own custom component class that derives from GazeAwareComponent, and calculate and return your own ProjectedRect struct specifying an axis-aligned rectangle on Screen that covers the area of the screen where your game object is displayed.


    Well I started a new project from scratch and I am not having any issues with the Gaze Aware Component. Actually it’s working remarkably well. I might just have an issue with my files importing from another computer. I had to upload them from another computer and open them on this one (the EyeX would not have worked on that computer). I really appreciate you getting to this question and answering it so thoroughly! I will have to give this some consideration when developing in the future, as that seems like it could be an extremely useful way to make GUI Buttons do what I actually want them to do lol.

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