I am trying to make a responsive UI but for some odd reason when the mouse is moving too fast, the button’s OnHover event doesn’t get registered. I’m guessing it has something to do with how the mouse is tracked. I have some ideas of how I may be able to fix this but I am wondering if there is an easy way to fix this issue? Maybe a project setting? Widget setting? Input setting?
You’ll see the issue I’m talking about in the video below. You can see that if I just mouse over the buttons, they work fine, but if I start swiping my mouse on them, sometimes the hover registers, sometimes it doesn’t.
This is an example of how I want it to function. Notice that if I swipe around like crazy, the buttons still register the mouse.
Hey man! So glad I’m not the only one experiencing this problem!
I don’t have a knock out solution, and I’m not at my desk to take the usual screenshots; however I’ll describe what we did to get full responsiveness.
After struggling with the same issue on all of unreal’s built in hover detection (either by using the canvas ui events or by using the actor hover events), we moved to directly observing mouse position on tick.
We have a menu manager blueprint that watches the mouse position, then based on the position, signals events to the children in the menu altering their hover state.
It is a heavier solution for sure, but it does get us a flawless responsiveness from the most wild of mouse movements.
Since we know that only one entity may be hovered at a time, we aggressively “unhover” all children each frame, unless it is presently hovered.
That logic works, but requires management of screen-space correlated to individual entity.
I am presently dealing with an issue where we altered the sizes of the items on our menu… You can imagine how that may have thrown off all those precise manager calculations
So this solution is heavy cause it kind of locks in positions, making it challenging to iterate on the menus.
My commitment to responsive menus runs deep… and i hope there is another way maybe…
Until then, i dive deeper into this and am presently looking into how to draw debug shapes in screenspace. While that doesn’t seem to be possible in the same way we’d use debugDraw plane/box/sphere; I’m hoping i can use a hud/canvas blueprint to directly call some kind of debug draw functionality
Anywho, gonna be messing with ways to draw either text, textures, lines to make iterating on this easier and more manageable.
Let me know if you (or anyone) finds some setting or a simpler way
Small follow up here on how we are approaching this now with better debugging tools. Our selectable objects need to be somewhat arbitrary, so this performs a translation between world to screen, then allows us to visualize where the mouse zones are.
Woa good work! Cool to see the responsiveness of the cards.
I was afraid the only way around the issue was building a custom mouse interaction system but, so far, that seems to be the case. The inconsistent responsiveness does bother me but the project I’m working on isn’t needing a crazy interactive UI so I’m going to have to live with it. I don’t have the technical knowledge yet to dive into the engine’s source code and figure out where things are going wrong but someday I will. Hope they fix it by then, though.
Thank you for taking time to post a reply and explaining your implementation. It will be definitely be helpful to someone who absolutely needs a responsive UI. I’ll mark it as the answer for now.
P.S. Love the art style, especially the shader, of your project.