How to make widget stay in screen?

So i made an invenorty and when i hover over one of the items it makes a new widget that shows the items stats, and that widget locations changes based on the mouse position.
How can i make it stay inside the screen ?

I have recently implemented this in my own project. You’d need to compare widget position (Get Position in Viewport / Canvas) and size (Get Desired Size) against the screen dimensions (Get Viewport Size) and override the widget’s position during tick if the bounds are exceeded:

The Select node here is either displaying the widget position at default location [false] - tracked by a world object in my case or overrides the widget Y in case it tries to display beyond the Y of the (viewport - widget size) [true].

The script here only cares about the bottom bit of the screen because that was what I needed. It seems to be working with no major kinks so far. You can pretty much ignore the offsets here, project specific stuff. I can’t remember what they do anyway, too lazy to comment on things that seems obvious at the moment of writing…

Hi I am having the same issue, would it be possible to repost the capture?

This is handled automatically when using the built-in tooltips. Are you?

Or do you need a custom solution?