# How to make a condition "no widgets of class in viewport"?

**URL:** <https://forums.unrealengine.com/t/how-to-make-a-condition-no-widgets-of-class-in-viewport/1178677>\
**Category:** Blueprint\
**Tags:** unreal-engine, question\
**Created:** [May 25, 2023, 9:57pm UTC](https://forums.unrealengine.com/t/how-to-make-a-condition-no-widgets-of-class-in-viewport/1178677 "2023-05-25T21:57:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ewelartist](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ewelartist](https://forums.unrealengine.com/u/Ewelartist)\
**Post date:** [May 25, 2023, 9:57pm UTC](https://forums.unrealengine.com/t/how-to-make-a-condition-no-widgets-of-class-in-viewport/1178677/1 "2023-05-25T21:57:31Z")

</div>

Hi,  
Is there possibility to make a condition “no widgets of class in viewport”?  
Thanks

---

<div class="post-metadata">

**Author:** ![rokenrock](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rokenrock/32/1040844_2.png) [@rokenrock](https://forums.unrealengine.com/u/rokenrock)\
**Post date:** [May 25, 2023, 11:02pm UTC](https://forums.unrealengine.com/t/how-to-make-a-condition-no-widgets-of-class-in-viewport/1178677/2 "2023-05-25T23:02:00Z")

</div>

Here’s the function to do that.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/d/2/cd2366841b2201fbf2c5b83b8afdae67d37483c5.png)

Get all widgets of the class & fail if any are in the viewport.

---

<div class="post-metadata">

**Author:** ![Ewelartist](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ewelartist](https://forums.unrealengine.com/u/Ewelartist)\
**Post date:** [May 26, 2023, 4:17pm UTC](https://forums.unrealengine.com/t/how-to-make-a-condition-no-widgets-of-class-in-viewport/1178677/3 "2023-05-26T16:17:09Z")

</div>

Thanks you so much!
