Disable mouse input when over widget

Hello,

unreal newbie here!I I try create Third Person RPG with WoWlike control. Now when i dont hold any button i have normal mouse cursor. When i hold left button and move mouse cursor is hidden and camera rotate around player. When right button is hold and move with mouse cursor is hidden and player character rotate. This work fine but if i try add a widget like action bar my problem pops up.

I want disable mouse input when mouse cursor is over the action bar so character or camera dont rotate when hold mouse button and move with mouse.

I try use on mouse enter > set input to UI only and when mouse leave > set input to Game and UI but now when my mouse is over actionbar a havnt keyboard input so i cant run etc.

I try use boolen for mouse enter and leave but when mouse is over the widget and i press mouse button boolen is set to leave.

Can someone help me please?

In the widget, override onMouseDown, check if it’s RMB and then pass Handled. This way the widgets will consume RMB input and the PC will be unable to detect it.

2 Likes

Thanks You very MUCH!!! I add this function to onMouseUp and double click too. Works pretty well.

hellow, you can create a blank widget and set CanvasPanel Visibility = Visible and add to viewport, to block all click event . But you must have to create some event to remove this blank widget befor you want to use mouse event

1 Like