Constrain UMG widget inside player screen

Hi all,
I’ve been messing around with UMG trying to create a menu that pops next to the mouse location. I got it to work almost like intended using ‘Get Mouse Position’ and ‘Set Position In Viewport’ nodes.
What I’m not being able to do is finding a way to keep the widget inside the player screen when you click for example in the lower, or right, portion of the screen. The picture shows what I mean, the current behavior (1) and the desired (2).
I don’t know if there are any built-in settings/nodes to do it, maybe playing with anchors?
Any help is much appreciated.
Thanks.

84236-untitled.png

Hey bro, i have same question, but not only for right-click menus but for dragAndDrop and dynamically created widgets. If you find any solution please let me know:)

Same, for a description box.

This is a link to another post with my solution…
Post with Solution