Please follow the setup steps in this Post as a prerequisite, as you'll need to have loaded the SDK package into your project, and added a GvrMain to your scene.
Setup the Scene
- On the GvrMain
- Add the GvrPointerManager script
- On the Main Camera under the GvrMain
- Add the GvrPointerPhysicRaycaster script
- Add a GvrReticlePointer prefab as a child of the Main Camera
- Add an EventSystem to the scene
- Remove the StandaloneInputModule script
- Add the GvrPointerInputModule
Add an Object to Gaze Upon
- Add a Collider component to your object (not Is Trigger)
- Add an EventTrigger script (will populate later)
At this point when you run the game, you should see the reticle in the viewer (both eyes), and when that reticle lands on your object, it should expand into a circle. If this occurs, then you did everything correctly.
Respond to Gaze Events
- Create a script that has functions that perform your desired actions for the gaze events, (i.e. on enter, on exit, on click, etc).
- Add events to your event trigger (on the object with the Event Trigger)
- Associate the events to functions in the script in step 1.
Now when you enter/exit or click when gazed at the object, your function actions should execute.
Having successfully completed it, I would recommend that you save the scene/project as a template which can be used later (or make a bunch of prefabs).
No comments:
Post a Comment