I want to have a go a creating some scripts that allow you to look at an object and when you do so it triggers another event to happen, such as you to teleport to a different place, or the object disappears to reveal something. By look at I mean when the target is over the object in Google cardboard SDK. Any scripts similar to this or that do this would be a brilliant way for me to begin to understand how this works. Thanks!
I would consider raycasting. I used this approach, raycasting from the camera (in Oculus/Gear, though, haven’t implemented in Cardboard… yet) and you can use this to get the raycast collision point.
If you have an Oculus, you can try out my example “Rogue VR” work-in-progress demo at http://www.sanctuarymedia.com/RogueVR/roguevr-demos-downloads/
It doesn’t do much, but it does show how you can use a look-direction-defined interaction icon to play the game with no controller (which also makes it much more comfortable – not dizzying/nausea-inducing)
The demo scene in the Cardboard SDK uses gaze to cause things to happen: look at the cube and it changes color, click and it teleports. You can use that as an example.
Yes… take a look at the methods in the GazeInputModule script for Cardboard… you’ll see it does raycasting like I’d mentioned, and then triggers things to happen at the raycast collision point.
What I’m looking to do next is change the default scripting so that I can use look-selection instead of trigger/button-select (ie. look at a target, show a countdown animation icon, and when time is up, trigger the event)… I did all this manually in Unity/Oculus VR already
Hi Guru20,
Did you find any solution? I am trying to teleport the cube in the demo scenes after 3-4 seconds delay but I am unable to do say… Can’t really understand the scripting… Could you or anyone else please help…
Regards,
Uzair Amir