I’m trying to get a quest marker widget to snap on the edge of the screen when the location isn’t shown where the camera points.
So far, I’ve been using “Project World Location to Widget Position” with great success for when the location is shown on the camera.
However, when it gets outs of bound, the snapping on the edge is very poor.
Here is my blueprint so far:
Currently, when the result bool “Return Value” is set to false, it’s usually because the actor location is more or less behind the character, so I was temporary snapping it to the bottom of the screen.
When the function returns true and the value are clamped, the location is more or less where it should be.
I’ve added a line trace so that you can visualize where the widget should be pointing.
Ideally, I’d like to find where this line intersect with the camera FOV, the project that point to the screen, and then move the widget to that point. How could I achieve this?