How to Convert a Widget's Local Position to Viewport Position in Unreal Engine 5


I need some help please, I need to find the viewport position of the GOLD AMOUNT widget (Text) in the game. The way I connected the nodes doesn’t seem to work as intended. I tried various nodes and searched through internet, but I can’t seem to find a solution. Essentially, I need to get the exact position of the HUD UI element on the screen. my coins will fly to that UI element no matter how my camera moves. This position should change based on the resolution and window size, as the absolute position will be different for each screen size. any idea? Thanks very much!

1 Like

Something like this?

Note this is using a canvas, you can place GOLD AMOUNT anywhere you wish and anchor it. The coins would fly there without needing to do any math since they all live in the very same container. This is as agnostic as it gets, even if the GOLD AMOUNT moves around during gameplay.


Assuming the coins are 2d widgets, it’d more tricky if we wanted world space stuff fly to screen location.

Thanks very much, this is what I wanted to achieve, however when I collect coin, it shall spawn a niagara effect. what I did was to spawn the coin niagara effect, in its emitter it has a point attraction force that attract the emitter to a user.TargetLocation, that’s why I wanted to find the exact location of that 2D UI element (in this case, it’s Gold amount text) on the screen. I’ll check out your project file. Thanks very much, very inspiring.