# How do I check if the widget is displayed on the screen?

**URL:** <https://forums.unrealengine.com/t/how-do-i-check-if-the-widget-is-displayed-on-the-screen/734307>\
**Category:** UI\
**Tags:** unreal-engine, Widget, Blueprint, question, UMG\
**Created:** [December 23, 2022, 3:05am UTC](https://forums.unrealengine.com/t/how-do-i-check-if-the-widget-is-displayed-on-the-screen/734307 "2022-12-23T03:05:29Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![NODARYN](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@NODARYN](https://forums.unrealengine.com/u/NODARYN)\
**Post date:** [December 23, 2022, 3:05am UTC](https://forums.unrealengine.com/t/how-do-i-check-if-the-widget-is-displayed-on-the-screen/734307/1 "2022-12-23T03:05:29Z")

</div>

Hi.  
I’m trying to find a way to determine if UMG is displayed on the screen or not.  
The functions “isVisible”, “IsRendered” work differently.  
For example, Tick is called only when the widget is active on the screen. So I want to understand how I can determine that the widget is active.  
Please tell me the best way.  
Thanks!

---

<div class="post-metadata">

**Author:** ![SolidSk](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/solidsk/32/1194513_2.png) [@SolidSk](https://forums.unrealengine.com/u/SolidSk)\
**Post date:** [December 23, 2022, 3:28am UTC](https://forums.unrealengine.com/t/how-do-i-check-if-the-widget-is-displayed-on-the-screen/734307/2 "2022-12-23T03:28:57Z")

</div>

Hi,  
You could use **Is in Viewport**.

[https://docs.unrealengine.com/5.0/en-US/API/Runtime/UMG/Blueprint/UUserWidget/IsInViewport/](https://docs.unrealengine.com/5.0/en-US/API/Runtime/UMG/Blueprint/UUserWidget/IsInViewport/)

---

<div class="post-metadata">

**Author:** ![NODARYN](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@NODARYN](https://forums.unrealengine.com/u/NODARYN)\
**Post date:** [December 23, 2022, 3:31am UTC](https://forums.unrealengine.com/t/how-do-i-check-if-the-widget-is-displayed-on-the-screen/734307/3 "2022-12-23T03:31:56Z")

</div>

This only works for the main widget. For child widgets, this is always called false.

---

<div class="post-metadata">

**Author:** ![SolidSk](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/solidsk/32/1194513_2.png) [@SolidSk](https://forums.unrealengine.com/u/SolidSk)\
**Post date:** [December 23, 2022, 4:06am UTC](https://forums.unrealengine.com/t/how-do-i-check-if-the-widget-is-displayed-on-the-screen/734307/4 "2022-12-23T04:06:38Z")

</div>

You could use **Construct**?

[https://docs.unrealengine.com/5.0/en-US/API/Runtime/UMG/Blueprint/UUserWidget/Construct/](https://docs.unrealengine.com/5.0/en-US/API/Runtime/UMG/Blueprint/UUserWidget/Construct/)

It will be easier if you tell us what you’re doing.  
Are you adding and removing the widget as a child?  
Are you adding and leaving it off the screen?

---

<div class="post-metadata">

**Author:** ![NODARYN](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@NODARYN](https://forums.unrealengine.com/u/NODARYN)\
**Post date:** [December 23, 2022, 4:11am UTC](https://forums.unrealengine.com/t/how-do-i-check-if-the-widget-is-displayed-on-the-screen/734307/5 "2022-12-23T04:11:59Z")

</div>

I have several nested UMGs in Widget Switcher.  
I need to make sure that a specific UMG is displayed on the screen at the moment.  
In this case, I can’t check it with the active index in Widget Switcher, because this Widget Switcher can be hidden from different places, but the active index will remain active.

---

<div class="post-metadata">

**Author:** ![NODARYN](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@NODARYN](https://forums.unrealengine.com/u/NODARYN)\
**Post date:** [December 23, 2022, 5:58am UTC](https://forums.unrealengine.com/t/how-do-i-check-if-the-widget-is-displayed-on-the-screen/734307/6 "2022-12-23T05:58:43Z")

</div>

Okay, I wrote my own function that recursively checks the activity of the current widget in the parent. It works perfectly.  
Be careful, because it can affect performance if you have too many nested widgets. But I don’t think there will be any problems if there are about 100 iterations.

If you know another more correct way, please tell me. But I researched the source code of the engine and unfortunately did not see anything like that, so that widgets recursively inform child widgets that they are no longer active.

```auto
bool UWidgetFunctionLibrary::CheckWidgetIsActive(UWidget* widget)
{
	if (!IsValid(widget))
	{
		return false;
	}
	
	while (IsValid(widget))
	{
		UWidget* parent = widget->GetParent();
		if (!IsValid(parent) || !parent->GetCachedWidget().IsValid())
		{
			return widget->GetCachedWidget()->GetVisibility() == EVisibility::Visible
				|| widget->GetCachedWidget()->GetVisibility() == EVisibility::HitTestInvisible
				|| widget->GetCachedWidget()->GetVisibility() == EVisibility::SelfHitTestInvisible;
		}
		
		FArrangedChildren arrangedChildren(EVisibility::Visible);
		parent->GetCachedWidget()->ArrangeChildren(parent->GetCachedWidget().Get()->GetPaintSpaceGeometry(), arrangedChildren);
		bool wasFound = false;
		for (int32 i = 0; i < arrangedChildren.Num(); i++)
		{
			if (arrangedChildren[i].GetWidgetPtr() == widget->GetCachedWidget().Get())
			{
				wasFound = true;
				break;
			}
		}
		if (!wasFound)
		{
			return false;
		}
		widget = parent;
	}
	return true;
}

```

---

<div class="post-metadata">

**Author:** ![E\_Misalign](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/e_misalign/32/1156826_2.png) [@E\_Misalign](https://forums.unrealengine.com/u/E_Misalign)\
**Post date:** [July 31, 2026, 2:51am UTC](https://forums.unrealengine.com/t/how-do-i-check-if-the-widget-is-displayed-on-the-screen/734307/7 "2026-07-31T02:51:44Z")

</div>

Hello

Hello , I Try to run this code in BlueprintFunLibrary,but get this error. how to fix it. thanks

UWidget\* parent = widget-\>GetParent();

error C2027: Used an undefined type “UPanelWidget”

---

<div class="post-metadata">

**Author:** ![SolidSk](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/solidsk/32/1194513_2.png) [@SolidSk](https://forums.unrealengine.com/u/SolidSk)\
**Post date:** [August 10, 2026, 3:49pm UTC](https://forums.unrealengine.com/t/how-do-i-check-if-the-widget-is-displayed-on-the-screen/734307/8 "2026-08-10T15:49:37Z")

</div>

Add this to your **ProjectName.Build.cs** file:

```auto
PublicDependencyModuleNames.AddRange(new[]
		{
			...,
			"UMG",
		});

```

And to your BlueprintFunLibrary file don’t forget to add:

```auto
#include "Components/PanelWidget.h"

```

---

<div class="post-metadata">

**Author:** ![E\_Misalign](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/e_misalign/32/1156826_2.png) [@E\_Misalign](https://forums.unrealengine.com/u/E_Misalign)\
**Post date:** [August 12, 2026, 1:18am UTC](https://forums.unrealengine.com/t/how-do-i-check-if-the-widget-is-displayed-on-the-screen/734307/9 "2026-08-12T01:18:17Z")

</div>

Thank you for reply.

Now I added the above two things according to your instructions.

The compilation prompt is as follows：

1\> Creating library E:EPICU\_ProjectLayoutIntermediateBuildWin64x64UnrealEditorDevelopmentLayoutUnrealEditor-Layout.sup.lib and object E:EPICU\_ProjectLayoutIntermediateBuildWin64x64UnrealEditorDevelopmentLayoutUnrealEditor-Layout.sup.exp 1\>Module.Layout.4.cpp.obj : error LNK2019: unresolved external symbol “\_\_declspec(dllimport) public: void \_\_cdecl SWidget::ArrangeChildren(struct FGeometry const &,class FArrangedChildren &,bool)const” (\__imp_?ArrangeChildren@SWidget@@QEBAXAEBUFGeometry@@AEAVFArrangedChildren@@_N@Z), function “public: static bool \_\_cdecl ULayBlueprintFunLibrary::CheckWidgetIsActive(class UWidget \*)” (?CheckWidgetIsActive@ULayBlueprintFunLibrary@@SA\_NPEAVUWidget@@@

what should I do？

---

<div class="post-metadata">

**Author:** ![SolidSk](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/solidsk/32/1194513_2.png) [@SolidSk](https://forums.unrealengine.com/u/SolidSk)\
**Post date:** [August 14, 2026, 7:43pm UTC](https://forums.unrealengine.com/t/how-do-i-check-if-the-widget-is-displayed-on-the-screen/734307/10 "2026-08-14T19:43:26Z")

</div>

Add to your **ProjectName.Build.cs** file:

```auto
PublicDependencyModuleNames.AddRange(new[]
		{
			...,
			"Slate",
			"SlateCore",
			"UMG",
		});

```

---

<div class="post-metadata">

**Author:** ![E\_Misalign](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/e_misalign/32/1156826_2.png) [@E\_Misalign](https://forums.unrealengine.com/u/E_Misalign)\
**Post date:** [August 24, 2026, 2:15am UTC](https://forums.unrealengine.com/t/how-do-i-check-if-the-widget-is-displayed-on-the-screen/734307/11 "2026-08-24T02:15:14Z")

</div>

The compilation was successful. Thank you for your reply. 👍
