World works correctly in Unity and in Desktop but not in VR

Hi, I’m having a weird issue where my Udon Sharp Scripts work in Unity and on VRC Desktop but they don’t work in VRC PCVR. If anyone could give me advice on how to debug this or any leads on what I should be checking here that would be appreciated.

I’ve been making a script which allows me to control a puck on a map. The idea is that there’s a item you grab (GameObject pestle) which outputs a ray. If you point the ray at a plane (GameObject map_detection) it takes the position that the ray hits the plane and moves a puck (GameObject map_puck) to the same local position on another plane.

I’ve gotten this to work in both Unity and Desktop VR but when I put on my headset and do PCVR suddenly nothing happens. I’m at a loss right now on how to debug this since it’s such a specific situation for it to not work. I’ve attached a picture of all of the code in the Sharp script, a picture of the setup, and a picture of the red puck having moved in the VRC Desktop version to show that it does work, just not in VR.



I would assume that there’s something wrong with the camera ScreenPointToRay function. That seems like a very unorthodox method to do this and I would encourage you to accomplish it with pure math operations, not relying on some random component’s helper functions. I’m not quite sure exactly what operation you’re trying to accomplish, but perhaps these other functions would be a starting point?

I replaced the ScreenPointToRay function with a empty gameobject set at the postion and rotation that I wanted the ray to come out of and this did the trick. The two functions you linked were related but were not necessary for my implementation.