Forum Discussion
sh0v0r
9 years agoProtege
Gaze Pointers & Drop Down Boxes
When I use a Drop Down box the Gaze Pointer disappears as it hovers over the items, is this a known issue?
6 Replies
Replies have been turned off for this discussion
- sh0v0rProtegeI think I've tracked it down to the OVRInputModule.GetGazePointerData
OVRRaycaster ovrRaycaster = raycast.module as OVRRaycaster;
overRaycaster is Null, I wonder if this has anything to do with the fact the DropList doesn't exist until it is dropped down? - sh0v0rProtegeOK, worked it out, the DropdownList GameObject that is created when the list is dropped down contains its own Canvas... I'll see if I can add the OVRRaycaster Component when it is instantiated...
- sh0v0rProtegeActually I'm a bit lost here on how best to tackle this, any help would be greatly appreciated...
- lanoumbiesseHonored Guesthi....did you find the solution?
- jhockingExplorerI may continue to look for a better way, but for now my dropdown menus are working in VR when I add this to the UI script:
// HACK for selecting dropdowns in vr
private void Update() {
if (XRSettings.isDeviceActive) {
var found = gameObject.GetComponentsInChildren<GraphicRaycaster>();
foreach (var gr in found) {
var ovr = gr.GetComponent<OVRRaycaster>();
if (ovr == null) {
gr.enabled = false;
ovr = gr.gameObject.AddComponent<OVRRaycaster>();
ovr.sortOrder = 20;
}
}
}
}
Basically, the idea is to look for GraphicRaycaster components (which are on the dropdown canvases) and replace with OVRRaycaster. - OCReaperHonored GuestWhat you can do is add this script to your Template inside your Dropdown
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class CanvasVRModifier : MonoBehaviour
{
public GameObject pointer;
private void Awake()
{
GraphicRaycaster gr = GetComponent<GraphicRaycaster>();
OVRRaycaster OVRrc = null;
if (gr != null)
{
gr.enabled = false;
OVRrc = gameObject.AddComponent<OVRRaycaster>();
OVRrc.pointer = pointer;
OVRrc.blockingObjects = OVRRaycaster.BlockingObjects.All;
}
}
}
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 8 years ago
- 6 months ago
- 6 years ago