Using OpenVR and Unity.XR with the existing UI

At this stage our project only needs a laser pointer and the ability to click UI buttons in VR and nothing else.
Based off a good read of the new XR Input system + this helpful script by [mention|wijgM2+f+6JNiRfchqJ6Nw==] I was able to add in my own VRButtonInput class that simply

  • subscribes to a ‘PointerOver’ event in my laser pointer script. (Steam VR laser pointer as a reference)

  • subscribes to a ‘Trigger’ event from the XR input script

  • Uses the event system to send the correct events to the button selected (pointed at)

Cheers

2 Likes