Forum Discussion
VCUMotorControl
3 years agoExplorer
UI button triggers not functional in build, but work as intended in editor
I am currently working to translate a VR game to the Oculus Quest 2 from a PC standalone version. In this game, I have created a VR menu with UI buttons that include box colliders with triggers active. These triggers have a script attached that when touched by the player, it will simulate the button being clicked.
private void OnTriggerEnter(Collider other)
{
if (other.gameObject.tag == "VRController" || other.gameObject.tag == "LeftHand" || other.gameObject.tag == "RightHand")
{
this.GetComponent<Button>().onClick.Invoke();
}
}
This works as intended in the Unity Editor, however, when I build the game, none of the triggers work as they should. I am unsure what the reason could be.
1 Reply
Replies have been turned off for this discussion
- VCUMotorControlExplorer
So I decided to abandon the box colliders for the menu items and implemented the OVR Laser Pointer that is included in the Oculus Integration package. This allows me to access each menu item without needing to put colliders on them. The main issue I am having is with the Start Level button on this menu screen.
The Start Level button works as intended in the editor, however it does not function in the build version. Somehow, every other button functions as it should, which is baffling.
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
- 6 months ago
- 9 months ago
- 11 months ago