How do I stop my touch input going through my UMG?

I have a touch input system that can rotate a camera by dragging your finger left or right across the screen.

There is also a UMG menu with a slider, however when I drag the slider my touch input drags the camera as well (even with other UMG layers behind the slider).

Is there a way to only affect the slider and not both the slider and the camera?

Hello! It depends on what nodes/code are used to rotate camera. Can you picture them?

It might be as easy as passing Handled in the widget:

But it may not be that easy, too. Depending on what else is going on - mainly how element hierarchy is using Visibility.

2 Likes

Would it be okay to expand on this? Would I make this a function like shown above and attach it after the touch event?

Override it in the widget that hosts the slider. In the widget you’d like to consume the touch:

1 Like

I have a touch input system that can
rotate a camera by dragging your
finger left or right across the
screen.

Assuming this is done in the player controller, passing handled should prevent the controller from receiving input.

Our team was having an issue where touch would bubble down to the game when pressing on UI and this was the only post we could find that actually fixed it. Thank you!

1 Like