I am currently using buttons as the slots in my inventory, mostly due to the practical “OnHovered” and “OnUnhovered” events.
However, while using the Enhanced Input System, clicking (with LMB) only fires when I am NOT also pressing one of these slots (buttons). I could imagine that is intentional, but is there any way to override it?
This happens no matter what kind of user widget I create, and is also the case for the bool function “IsHovered” and the events “OnMouseEnter” and “OnMouseLeave”.
No matter what I seem to do, when LMB or RMB is clicked or held, “OnMouseLeave” is called or “IsHovered” is set to false… Is there really no way in the whole of Unreal Engine 5 that lets me disable these strange behaviours? I understand how it could be useful in some cases, but right now it’s seriously obstructing my work, and I have no idea how I would go about creating similar functions without taking a massive performance hit or unnecessary amounts of extra work…
I would appreciate if anyone else has encountered the same, and especially if there are known workarounds for this!
i think your problem is the mouseclick isnt ‘Handled’ and so goes through to the world which causes the mouse to leave the widget, try overriding OnMouseButtonDown and return handled
Thank you so much! Thanks to your input I just figured out that I could ward off the problem by setting the “Viewport Mouse Capture Mode” to “Do not capture”. Problem is, now my enhanced input action using the mouse buttons won’t fire anymore… Unless I double click?? I really have no idea what’s going on…
Back to your solution though, how do you suggest I go about doing that? I am still relatively new to the engine and I have absolutely no idea how to "Override OnMouseButtonDown and return handled” or really what it even means.
I really don’t understand why Unreal won’t let me use the mouse buttons the same way I use the keyboard keys! It makes it incredibly frustrating to implement essential game mechanics with rebindable keys, when I have to make these strange exceptions and workarounds for all bindings that use mouse buttons! Is there any simple way to disable all the strange extra functions built-in to Unreal, and simply use them as I would keyboard keys?
I struggle to understand this engine, and really appreciate the help! “:D”