O'Reilly logo

Virtual Reality Blueprints by John Williamson, Charles Palmer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Setting touch control

Accepting user input will be done as part of a two-step process when the Gear VR's trackpad button is pressed. First, we need to determine if the user clicked on a selectable GameObject: if this is TRUE, we then need to capture which GameObject was selected and, finally we need to switch the FullImage with the image of the current GameObject. We'll address identifying and capturing the GameObject (our Preview images) within the OnPointerDown function.

As mentioned at the start of this chapter, we will use a Graphic Raycaster to project a ray into the scene. However, instead of doing this all the time, we only need to do this when the trackpad button has been pressed. We can then determine if the ray collides with a UI ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required