- Home /
UI Buttons for GEAR VR not working
I am using classes using from VR sample projects for Oculus . I can interact with other objects by attaching the VRInteractiveItem and another script to determine what happens when a user clicks on the Gear touch pad. BUT i am failing to make the user interact with the UI buttons even if i add the VRInteractiveItem . Can I be kindly assisted. @alishka
Answer by jmgek · Feb 24, 2017 at 08:12 PM
UI buttons use raycasts to trigger events like OnMouseClick(), OnHover(), etc.
You can't interact with the UI buttons unless you design your own UI handler on the remotes or Raycast on the headset from where you're looking. VRInteractiveItem is for physical objects with colliders attached. They don't handle raycasts.
This is how I solve VR buttons: https://www.assetstore.unity3d.com/en/#!/content/79540 But you can use this solution too: https://unity3d.com/learn/tutorials/topics/virtual-reality/user-interfaces-vr
Answer by tafadzwajoseph · Feb 25, 2017 at 08:08 AM
Thank you @jmgek
I have eventually found the solution also with the help of https://unity3d.com/learn/tutorials/topics/virtual-reality/user-interfaces-vr
since VRInteractiveItem requires colliders I had to put a collider on my button and then attach the VRInterectiveItem and the script i want to call.
Your answer
Follow this Question
Related Questions
How to create real water? 5 Answers
Getting log from unity and ECG physiological markers using VB script 2 Answers
Removing unneeded shaders Shader Unsupported Hidden/VR/BlitCopyFromTexArray 0 Answers
playing audio with the GoogleVR Reticle Script 0 Answers
Trying to create a camera that follows player and mimics headset tracking(HTC Vive) 1 Answer