Search code examples
c#unity-game-enginevirtual-realitygoogle-cardboard

Play/Pause video using gaze pointer in unity3d


I am trying to show & play a video using Gaze pointer in Unity3D. So when i gaze over an object for a particular time, the video must play and when i look away, the video must stop. It should restart when i look back again at that object.I am using google vr sdk, swipe menu & a custom gaze pointer for this.When i gaze at one of the slides, the video should play. I am relatively new to Unity3D and c#. So please help me with this. I would also like to know how this can be made interactive using the controls in a google cardboard based vr?


Solution

  • Never thought this would be so simple. Solved this using Google VR SDK. Used Google's reticle pointer to gaze through the menu items. Use the 'Event trigger' to add events such as video player.play() & videoPlayer.stop(). In order to show & hide the video player, user videoPlayer.setActive(); Feel free to comment if anybody ever needs more details on this.