# How do I remove a widget when i click at a random place?

**URL:** <https://forums.unrealengine.com/t/how-do-i-remove-a-widget-when-i-click-at-a-random-place/454888>\
**Category:** UI\
**Tags:** removal, remove-from-parent, click-event, unreal-engine, Widget, question\
**Created:** [September 5, 2019, 12:38pm UTC](https://forums.unrealengine.com/t/how-do-i-remove-a-widget-when-i-click-at-a-random-place/454888 "2019-09-05T12:38:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_ce888f58](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_ce888f58](https://forums.unrealengine.com/u/anonymous_user_ce888f58)\
**Post date:** [September 5, 2019, 12:38pm UTC](https://forums.unrealengine.com/t/how-do-i-remove-a-widget-when-i-click-at-a-random-place/454888/1 "2019-09-05T12:38:13Z")

</div>

Hello Guys, I’m adding a widgets on the screen when you click on specific mesh. My question is, how can i manage to remove this widget from the screen when i click anywhere but the specific mesh? I need to make ‘on click events’ for everything on the scene but the specific mesh and delete the old mesh on click? Or is there some other more professional way?

---

<div class="post-metadata">

**Author:** ![MrMcKvarz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MrMcKvarz](https://forums.unrealengine.com/u/MrMcKvarz)\
**Post date:** [September 5, 2019, 3:42pm UTC](https://forums.unrealengine.com/t/how-do-i-remove-a-widget-when-i-click-at-a-random-place/454888/2 "2019-09-05T15:42:43Z")

</div>

You can look at InputComponent, there is an event for touch, but you can also use it with a mouse click. So when that fires you trace stuff under the cursor, and if it doesn’t hit your mesh you remove that widget.
