ScreenToWorldPoint acting differently on a Mac compared to a PC

I have set up some editor tools for helping in doing some level editing. I mostly work on a PC, but then at least to do iOS builds I open the project on a mac. But there is one thing that seems to behave differently on the mac. Getting the coordinates within the scene seem to work in the same fashion, but when I call

camera.ScreenToWorldPoint(posInScene)

on Windows the correct position is returned but on the mac it returns something entirely different. What could be the reason for this? And how could I fix this? I’m doing this in OnSceneGUI.

A possibly related thing I’ve noticed is that for some weird reason camera.rect is always camera.rect(x:0.00, y:0.00, width:1.00, height:1.00) on PC, but on a mac for “Layout” events it’s (x:0.00, y:-0.99, width:2.00, height:2.00). Could someone explain that? :face_with_spiral_eyes:

Has someone had similar experiences or have an idea why eg on the Mac the camera.rect is different for the Layout event?

No one’s had the same issue?

I have the same issue with Camera.current.ScreenPointToRay.
Have you found what’s wrong?

I found the the workaround: use HandleUtility.GUIPointToWorldRay instead of camera.ScreenToWorldPoint.

1 Like

I actually moved on to another project, and also primarily working on a PC, it’s not that important, so I didn’t find a solution.

But thanks for sharing your finding! That might come in handy if I do something similar or some day return to that earlier project!