ProjectWorldLocationToScreen false case

I think the case when ProjectWorldLocationToScreen returns false needs to be treated explicitly. In my tests the screen coordinates were always 1 when the method’s return value was false.

Sam sais that it’s ok when the world location is off screen because we can have the tunnel centre off screen. But 1/1 is not off screen, it is just in one corner. As with many boolean functions that give you further results in ref or out params (think of typical raycast functions), I think you are not supposed to take those params as meaningfully set when the return value was false. Maybe the poster of this issue encountered the same problem, as lateral movement (in the sense of strafing) is the prime example where you get an off-screen world location.

Could also be that the method implementation was changed since Sam’s recording; I am using UE 5.3 currently. Unfortunately, the docs of the method are not really verbose. A quick glance into current engine source code seems to support my results.

(Concerns lecture “Creating Tunnel Vision” from the Unreal VR course).

It is possible it has changed. This course was originally designed for the original HTC Vive and most people (I suspect anyway) will be using a quest of some sort. I do know I had a WMR HP Headset and things were different with that when I ran through the course and it did cause a few issues but it also works fine with the Quest 2.

I’ve tested the materials and I do know they mostly work. The Blinkers I was never a fan of them.

I’m glad to see (and I’m sure Sam would be too) that the course still encourages conversation so many years after it was released.

As for the docs. Back when the course was released, the documentation was actually really good. These days it is pretty dire. It adds to the complexity of learning the engine unfortunately.

Good luck with the course and I do hope you’re enjoying it.

1 Like

Privacy & Terms