How do I get mouse clicks to ignore world when over UI

Currently my game has left clicking assigned to selecting and deselecting actors. When i have an actor selected, it brings up a UI menu of options to perform. If I click on the UI, it is still interacting with the game world behind it. If I miss a button by a pixel it will then deselect my actor.

How do I get it to stop interacting with the gameworld while the mouse is over the UI? The main CanvasPanel of the widgets cover the whole screen, so when I tried using EventOnMouseEnter/Leave with SetInputModeUIOnly, it stops all game input.

Try the enable/disable input function in Player Controller?

I have this question as well. Did you find a good solution?

Workaround: create a border to cover the screen with the lowest non-zero opacity possible behind your widget. It would not be distinguished by the human eye and prevent clicking in the world.

Ya, I ended up making a transparent button and stretching it across the entire screen. If a border blocks mouse clicks, that would be slightly simpler. I’m somewhat surprised that you can’t make images in widgets block clicks.