Interaction SDK Google VR with buttons list inside a scrollView

Hi everyone,

I’m developping a VR app in Unity using Google VR SDK for Android.
I’ve created a scene with a World Space Canvas where I placed a ScrollView with a buttons list. This ScrollView has an Image with a Mask.

My problem occurs when I try to press some button (inside the previous list) in order to execute its corresponding trigger. This trigger is executed in the Editor view. However, when I export my VR app to a device, is NOT executed but I can view the “click effect” in GUI when I try it.

I debugged my app using ADB and not occurrs any problem in the device.
How could I resolve my problem??

Thank in you in advance

How are you selecting your selecting the item on the device? Are you using the Daydream controller to do it?

When you say Google VR SDK I assume you mean that you imported the Google Unity SDK package into your application?

Hi, sorry for the delay in answering.
I imported the Google VR SDK in my project and I’m selecting the button (int the scrollview list) through the GazeInput controller. Is necessary to configure the EventySystem in some particular way?? Actually I attached the GazeInput script to this element.

Thank you in advance.

I forgot to hightlight that I’m not using Daydream controller :slight_smile:

This might help:

I haven’t tried this on Cardboard before and this gentleman posts a lot in our forums with help like this.

Thanks joejo! This video also is good for VR & Unity UI interaction: youtu.be/iW0mP-hpRkk

It sounds like the Scrollview is working in Editor, just not when building. Are you building for GearVR by chance? I have a scrollview working in Editor, will test on device momentarily.

Ok, add an Event Trigger component to the button’s gameobject, move the button’s OnClick() events to the Event’s Trigger’s OnPointerDown() event.

Hi, everyone! First of all, thank you for answering so quickly.

In the video that joejo has provided does not work with any World Space Canvas component. My problem consist of that if I work in the Editor my current Canvas, thant contains a Scrollview with a buttons list (as can see in the picture), works correctly. If I click with my Reticle in some button, his corresponding trigger is launched (in this case, to print the message “PULSADO ”). But if I export my Google VR (Carboard App) to my Android device, buttons triggers are not launched.

Like Selzier has commented, I’ve tried performing these step, I added an Eventrigger to each button, including his corresponding functionality inside it, but the problem in this case… I can’t scroll the list (is completly static).

How could I solve my problem??

Thank you so much!

I forgot to comment that in the EventSystem component I added the GazeInputModule, like can you see in the picture.

[SOLVED]:):):slight_smile:

The problem was solved following next steps:

  • Like Selzier said in previous comments, I attached an EventTrigger component to each buttons.
  • In order to be able to scroll the list, is necessary to reference, in the Scrollview, a Scrollbar element.
  • By this way, it is possible to move the scroll using the scrollbar, and launch buttons triggers inside the scrollview.

The final conclusion is that to perform a scroll view in VR, it is necessary to include a Scrollbar in ScrollView and reference it, in this element.

The result is shown in the following image:

2941900--217736--final_image.jpg

Good job sir! I have a pack coming soon with examples of all UI elements, along with options to:

  • Perform a ‘click’ via gaze only
  • Change Reticle / Dot
  • Add outline to objects
  • Interact with object/UI based on DISTANCE

Please could you tell me in detail @davidskick ? I’m new to this thing, it’s a bit confusing.