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.