Check if widget is visible / on screen

How do we check if a Widget is currently on the screen before we “Remove from Parent?”

If true, remove.
If false, do nothing.

Thanks!

1 Like

Use the IsVisible node from the Widget blueprint.

68962-ue4_widget_visible.png

In 4.11 version of the engine I use IsInViewport function. I’m not sure if it’s new or already was present in previous versions.

3 Likes

Hello.
What about 4.21.1? Cant find any of those :frowning:

I guarantee that both of those functions exist in 4.22 & 4.23
To verify this for yourself you can right click in any empty section of event graph, uncheck “context sensitive” and type in “is visible” and “is in viewport”.
If you are dragging off a node, right clicking, and typing in “is visible” or “is in viewport” then you are not dragging off a valid target, make sure you are targeting a widget.

1 Like

Currently using UE 5.3 and I would like to know if there is any concenseous on which to use?
(is visible VS is in viewport)

1 Like