# Can't click HUD buttons after adding it to viewport

**URL:** <https://forums.unrealengine.com/t/cant-click-hud-buttons-after-adding-it-to-viewport/362868>\
**Category:** UI\
**Tags:** hud-blueprint, unreal-engine, Widget, UE4, CPP, question\
**Created:** [July 4, 2016, 6:11am UTC](https://forums.unrealengine.com/t/cant-click-hud-buttons-after-adding-it-to-viewport/362868 "2016-07-04T06:11:25Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![WolfAlvein](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@WolfAlvein](https://forums.unrealengine.com/u/WolfAlvein)\
**Post date:** [July 4, 2016, 6:11am UTC](https://forums.unrealengine.com/t/cant-click-hud-buttons-after-adding-it-to-viewport/362868/1 "2016-07-04T06:11:25Z")

</div>

Hi everyone.

I have in screen a touch interface blueprint and a Widget Blueprint and I need both to interact to different touches but when I add the widget to the screen I activate and then i move it to the background has seen in the lower code.

```
currentHUD->SetVisibility(ESlateVisibility::Visible);
currentHUD->AddToViewport(-15);		

```

But when in the game I try to touch the buttons on the widget, they are completely disabled and can’t be reached by the screen taps, but the interface blueprint does react when you touch it, any help with this issue would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![Mookaroni](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mookaroni](https://forums.unrealengine.com/u/Mookaroni)\
**Post date:** [July 4, 2016, 7:19am UTC](https://forums.unrealengine.com/t/cant-click-hud-buttons-after-adding-it-to-viewport/362868/2 "2016-07-04T07:19:42Z")

</div>

Are you trying to make it so that both of them are active at the same time? If so, they should be on the same Z-Order value (ie both -15 in this case)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_e723619f](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e723619f](https://forums.unrealengine.com/u/anonymous_user_e723619f)\
**Post date:** [July 4, 2016, 12:51pm UTC](https://forums.unrealengine.com/t/cant-click-hud-buttons-after-adding-it-to-viewport/362868/3 "2016-07-04T12:51:40Z")

</div>

Using blueprints, you need to enable a “Set Input Mode UIOnly” node with the UI widget in focus.

Not sue how to do that in C++

---

<div class="post-metadata">

**Author:** ![WolfAlvein](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@WolfAlvein](https://forums.unrealengine.com/u/WolfAlvein)\
**Post date:** [July 5, 2016, 6:04pm UTC](https://forums.unrealengine.com/t/cant-click-hud-buttons-after-adding-it-to-viewport/362868/4 "2016-07-05T18:04:31Z")

</div>

HI Mookies, how can I set both of them to the same Z-Order Value, I can’t seem to get a way to access the Virtual Joystick, I only have a reference to my Widget, thanks for your help.

---

<div class="post-metadata">

**Author:** ![Mookaroni](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mookaroni](https://forums.unrealengine.com/u/Mookaroni)\
**Post date:** [July 5, 2016, 6:16pm UTC](https://forums.unrealengine.com/t/cant-click-hud-buttons-after-adding-it-to-viewport/362868/5 "2016-07-05T18:16:35Z")

</div>

Ah sorry, I think I read your question wrong. Could you provide a screenshot of the designer tab of your widget please?

---

<div class="post-metadata">

**Author:** ![WolfAlvein](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@WolfAlvein](https://forums.unrealengine.com/u/WolfAlvein)\
**Post date:** [July 5, 2016, 6:34pm UTC](https://forums.unrealengine.com/t/cant-click-hud-buttons-after-adding-it-to-viewport/362868/6 "2016-07-05T18:34:59Z")

</div>

Yes, of course, here is the screenshot.

 ![97251-capture.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/8/3/783e1da1d7cc73b643f7f2fd779da5d501b75e30.png)

And here is a screenshot of the game during play:

 ![97252-capture.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/2/7/2276f5a80dd9c6ec911ebe9104d98bbef245257c.jpeg)

---

<div class="post-metadata">

**Author:** ![Mookaroni](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mookaroni](https://forums.unrealengine.com/u/Mookaroni)\
**Post date:** [July 5, 2016, 7:03pm UTC](https://forums.unrealengine.com/t/cant-click-hud-buttons-after-adding-it-to-viewport/362868/7 "2016-07-05T19:03:40Z")

</div>

is currentHUD in your code, by any chance, the name of your widget? Try changing

currentHUD-\>AddToViewport(-15);

to

currentHUD-\>AddToViewport(0);

---

<div class="post-metadata">

**Author:** ![WolfAlvein](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@WolfAlvein](https://forums.unrealengine.com/u/WolfAlvein)\
**Post date:** [July 8, 2016, 3:25pm UTC](https://forums.unrealengine.com/t/cant-click-hud-buttons-after-adding-it-to-viewport/362868/8 "2016-07-08T15:25:03Z")

</div>

Hi Mokkiez, sorry for not responding before, I tried what you told me to do but when I add it into the 0 position, both the joystick and the buttons don’t work. Any other idea of how this could be solved?

---

<div class="post-metadata">

**Author:** ![Mookaroni](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mookaroni](https://forums.unrealengine.com/u/Mookaroni)\
**Post date:** [July 8, 2016, 8:04pm UTC](https://forums.unrealengine.com/t/cant-click-hud-buttons-after-adding-it-to-viewport/362868/9 "2016-07-08T20:04:22Z")

</div>

Hi Wolf, sorry you’re still having issues.

What you’re going to want to do is, after adding the UMG to viewport at 0 Z-Order, revert (in your PlayscreenHUD UMG) the Visibility back to ‘Self Hit Test Invisible’

---

<div class="post-metadata">

**Author:** ![WolfAlvein](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@WolfAlvein](https://forums.unrealengine.com/u/WolfAlvein)\
**Post date:** [July 9, 2016, 5:44am UTC](https://forums.unrealengine.com/t/cant-click-hud-buttons-after-adding-it-to-viewport/362868/10 "2016-07-09T05:44:57Z")

</div>

Hi Mookiez.

Like you told me after I added the UMG to Viewport at Z-Order (0), I set the visibility to ‘Self Hit Test Invisible’, I tried also the other options of self hit but they won’t react to any input I pass using the mouse or touch screen from my mobile, but the Joystick was re-enabled, any idea how I can have both react to the inputs?

---

<div class="post-metadata">

**Author:** ![WolfAlvein](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@WolfAlvein](https://forums.unrealengine.com/u/WolfAlvein)\
**Post date:** [July 13, 2016, 6:10pm UTC](https://forums.unrealengine.com/t/cant-click-hud-buttons-after-adding-it-to-viewport/362868/11 "2016-07-13T18:10:14Z")

</div>

Hi Mookiez, do you have any idea of what could help me with this issue?

---

<div class="post-metadata">

**Author:** ![Mookaroni](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mookaroni](https://forums.unrealengine.com/u/Mookaroni)\
**Post date:** [July 14, 2016, 7:28am UTC](https://forums.unrealengine.com/t/cant-click-hud-buttons-after-adding-it-to-viewport/362868/12 "2016-07-14T07:28:13Z")

</div>

Oh boy, you’re still having issues? Sorry about that, I thought I recreated the issue and figured it out on the last comment. I have to say I’m not quite sure anymore. I recommend you get the attention of a staff member or someone similar who has more knowledge about this than I do

---

<div class="post-metadata">

**Author:** ![jmgomez.me](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jmgomez.me/32/620405_2.png) [@jmgomez.me](https://forums.unrealengine.com/u/jmgomez.me)\
**Post date:** [March 15, 2022, 3:25pm UTC](https://forums.unrealengine.com/t/cant-click-hud-buttons-after-adding-it-to-viewport/362868/13 "2022-03-15T15:25:14Z")

</div>

I just faced this problem too. What worked for me was to add a crazy high negative number in the widget that didnt have any interaction with the user. I approached it by having a custom base widget class where I specify it through the widget editor.
