I’m trying to put a reticle (widget that I added to the viewport) over the impact point of a ray trace. However, when I convert the world coordinates to screen coordinates, the screen coordinates are way off in the bottom right corner. I tried subtracting half the resolution, but there was still considerable offset from where it is supposed to be. Building off of that, I experimented with different screen resolutions, but each one has a different offset from center and in different ways, so I can’t just compromise with some sort of set distance. I also tried “Project World to Screen” instead, which has a slightly different location but still very wrong. Here’s the most relevant code:
I discussed this extensively with someone in the UE discord to no avail. Looking online, it seems like this is a common issue with no concrete solution. We also tried using the hit result’s “location” instead of “impact point”, and messing with “set alignment in viewport”.
A few other notes, this code executes in the HUD, and I can confirm that setting the widget location to (0, 0) is definitely the center of the screen.