Hi, I’m making a game, but ran into a problem. I have a globe that you can rotate around using LMB HOLD and mouse cursor, but I couldn’t get it to work so that on LMB CLICK I can select region on the globe. It either felt weird, laggy or just wrong. How can I make that work with enhanced inputs? I’m just learning the enhanced inputs and I’m really confused. I need it to be so that when you hold LMB it doesn’t fire CLICK event.
I’m pretty sure when it comes to click/hold behaviour, you need the click action to trigger on release rather than on press.
Specifically:
- When you click and release fast enough → “Click” action
- When you click and hold long enough before releasing → “Hold” action
It is done like this in Dark Souls, where you tap the button for dodge and hold it for sprint. It makes dodge “on release” rather than “on press” which some people call input lag.
Another approach could movement based instead of time based, where you only initiate the “Hold” action when you move the mouse while it is pressed, else it would be a “Click”.
I haven’t used Enhanced Input, so I can’t provide you with a prototype though.
1 Like