Clicking a widget border, makes character move

Imagine a game like Diablo 3. When you open an npc window, if you click any point on that window, your character does not move there in game world. It’s like my borders are transparent for mouse input. How do I make that happen?

I can not use input mode for UI only because the window is only left side of the screen. Character should be able to move right side when clicked.

Thanks.

1 Like

I want it to block the input into the landscape if player clicks on the widget.

1 Like

Set the border’s Visibility to SelfHitTestInvisible. This way it will not register user input and let the click tunnel through unless another widget is in the way. If no widget handles the input, it will be passed to the Player Controller.

Alternatively, you can have the border return Unhandled on click.

Oh sorry, misunderstood you. Set the border’s visibility to Visible then.

With the input mode set to Game and UI, clicking a visible border will not send anything to the PC. Perhaps your widget is wrapped with something else that makes it ignore input.

I’ve just tested it in an empty project. The input is not sent. Consider posting your setup in case you can’t get it to work the way you need.

Maybe your input is set to Game only?

That doesn’t work

Every widget is visible by default. That doesn’t block the input.

It’s game and ui input and all things in the widget is set visible but character moves when I click it

there is no onClick event on border, which one is it?

Doesn’t print anything, with this:

No, no it does. Okay it’s working right now.

There is a scroll box on top of the border. I set that hit visible and it works okay now. Thank you.

Can you override the onMouseDown in the widget and PrintString. See if it registers at all. Not being able to detect widget input is a tad strange, indeed.

It can be the widget’s override or the border’s Event. OnMouseButtonDown will do. Just return Handled from the function.

Wicked, cheers!