Forum Discussion
Weitin
7 years agoProtege
How to use graphics raycaster with physics raycaster?
I'd like to be able to interact with UI elements and 3D objects together in the same scene. I have the OVRRaycaster on my canvas, and OVRPhysicsRaycaster on the OVRCameraRig. Both work correctly by themselves, but the Physics Raycaster will still hit an object even if there is a canvas in front of it.
I've played around with the blocking objects, blocking masks, and other settings. I've tried EventSystem.current.IsPointerOverGameObject() but it didn't seem to do anything. And I've tried to tweak the OVRPhysicsRaycaster script to no avail.
From what I've read, the Physics Raycaster doesn't detect any graphic elements, so potentially Graphic Raycasts should be done first, and if nothing is hit, then call Physics Raycaster? Does the Oculus SDK have a solution for this or am I better off writing my own system?
I've played around with the blocking objects, blocking masks, and other settings. I've tried EventSystem.current.IsPointerOverGameObject() but it didn't seem to do anything. And I've tried to tweak the OVRPhysicsRaycaster script to no avail.
From what I've read, the Physics Raycaster doesn't detect any graphic elements, so potentially Graphic Raycasts should be done first, and if nothing is hit, then call Physics Raycaster? Does the Oculus SDK have a solution for this or am I better off writing my own system?
2 Replies
- WeitinProtegeI solved it, OVRPhysicsRaycaster sort order is set to 20 by default, I set it to 0...
- rathna11Honored GuestCan you please help me by telling me what did you write in the script that is attached to 3d object. Because I have OVR physics raycaster on OVRcamerarig & OVRraycaster on canvas I'm able to interact with canvas but not 3D object. Im using Input.GetMouseButtonDown(0) on 3D object. Can you please help me with this
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 months ago
- 5 months ago
- 2 months ago
- 3 years agoAnonymous