cancel
Showing results for 
Search instead for 
Did you mean: 

OVRGazePointer error

Soundmartell
Explorer
Hello, I have been using the OVRGazePointer.cs without having any error till I update Unity to 2017.0.0f3.
Now I am getting this error:
NullReferenceException: Object reference not set to an instance of an object
OVRGazePointer.LateUpdate () (at Assets/OVR/Scripts/Util/OVRGazePointer.cs:247)
I will appreciate any help.

8 REPLIES 8

Soundmartell
Explorer
Hello,
Unity v2017.3.0f3, Oculus Utilities v1.21.0
Mac OS Hight Sierra.

tamer_ozturk2
Explorer

This error is because you are using the utility inputmodule script but you have no gazepointer prefab in your scene. The utility script is faulty and calling for the instance variables before the gazepointer is actually initialized.

You will recieve this error once or twice at the beginning and then after the gazepointer will be initialized, you wont see it anymore.

I suggest to write your own gazepointer script anyhow.

Soundmartell
Explorer


This error is because you are using the utility inputmodule script but you have no gazepointer prefab in your scene. The utility script is faulty and calling for the instance variables before the gazepointer is actually initialized.

You will recieve this error once or twice at the beginning and then after the gazepointer will be initialized, you wont see it anymore.

I suggest to write your own gazepointer script anyhow.



Thank you but this error never happen before in the project. I do have a Gazepoiter prefab. The error doesn't appear once or twice but infinity. 
Regards.

tamer_ozturk2
Explorer




This error is because you are using the utility inputmodule script but you have no gazepointer prefab in your scene. The utility script is faulty and calling for the instance variables before the gazepointer is actually initialized.

You will recieve this error once or twice at the beginning and then after the gazepointer will be initialized, you wont see it anymore.

I suggest to write your own gazepointer script anyhow.



Thank you but this error never happen before in the project. I do have a Gazepoiter prefab. The error doesn't appear once or twice but infinity. 
Regards.



So, you do the reasonable and check the line 247 which is; Quaternion trailRotation = trailFollower.rotation;

if this is null error, that means you dont have a trailFollower object as a child of your gazepointer object.

markncolleen198
Protege
HI, i also have this error. unity 2017.2.1f1  Ovr plugin 1.21.0
How to replicate:
1) Load up the tutorial from page:
https://developer.oculus.com/blog/unitys-ui-system-in-vr/

2) Open the demo scene VRPointers press play6ro8kciri7fl.png

tamer_ozturk2
Explorer


HI, i also have this error. unity 2017.2.1f1  Ovr plugin 1.21.0
How to replicate:
1) Load up the tutorial from page:
https://developer.oculus.com/blog/unitys-ui-system-in-vr/

2) Open the demo scene VRPointers press play6ro8kciri7fl.png




When you upgrade to 1.21 or any other new version, first thing to do is to check the included scenes rather than blog posts. Because blog posts are old and as far as i understand oculus is not very fast at updating scattered documents.

Like i said above, the new script requires a different OVRGazePointerRing prefab which has a trailFollower object in its hierarchy as well.

Nevermind the blog tutorial, and open the UI Scene provided in OVR Utilities scenes. Check the OVRGazePointer there and you will see trailFollower.

***********

I am also just learning this oculus vr thing, ive had the same errors as you did, but i read the whole code and understood whats going on now. My humble suggestion is:

Rewrite the following scripts to suit your own game and also fix bugs, because them as in their current form are just hastily written unoptimised scripts but still a good learning material:

OVRInputModule, OVRRayCaster, OVRPhysicsRayCaster, OVRMousePointer, OVRGazePointer

Just to give you an idea forexample, if you change OVRRayCaster.cs line 211 into this:

 if (graphic.depth == -1 || !graphic.raycastTarget || (pointer == graphic.gameObject))

Then, you will be able to use the RaycastTarget variable in your UI items, but it is currently missing...etc

sid1314
Honored Guest


Hello, I have been using the OVRGazePointer.cs without having any error till I update Unity to 2017.0.0f3.
Now I am getting this error:
NullReferenceException: Object reference not set to an instance of an object
OVRGazePointer.LateUpdate () (at Assets/OVR/Scripts/Util/OVRGazePointer.cs:247)
I will appreciate any help.



Its to do with the Script OVRGazePointer. Its looking for "GazeIcon" Gameobject for the the Gaze Pointer image.

If you change the script and change the variable GazeIcon from a private Transform to a public Transform and delete the line where the GazeIcon searches for the GameObject, you can manually assign the GazeIcon in the Inspector.



WISiHUB
Honored Guest
@sid1314: your solution worked for resolving the error. Here I have attached screenshot of what to assign to "GazeIcon"

kre6rqeliu9l.png

 successfully worked on n Oculus GO