In a new project of mine I’m creating a 2D game and want to show the mouse while the inputmode is set to gameonly so my hud widgets wont be clicked.
I noticed however that only some mouse clicks gives a response. I tracked the problem down to being caused by the combo of ShowMouseCursor=true and SetInputModeGameOnly.
When I check this out in an old project [UE 4.8.3] all mouse clicks gives a response.
After some more testing I noticed that if you click continually but with large intervals there will be no responses from any clicks. If you do it fast then it seems every second click has a response. It is like something somewhere gets focus for a moment allowing the next click to work.
Testing it is really simple.
- Simply create a new blank project and add a custom PlayerController and GameMode(so we can add the PlayerController) and set them as the default in ‘Project Settings’ → ‘Maps & Modes’.
- Goto the ‘Project Settings’ → ‘Input’ and create a new Action Mapping set to ‘Left Mouse Button’(have not tried if the other options gives the same behavior).
- Goto custom PlayerController and add the Action Mapping event and drag a node of to a Print String or something similar that can easily give us feedback.
- Add a ShowMouseCursor node set to true from the PlayerController BeginPlay event and also add a SetInputModeGameOnly to the BeginPlay event (the order is irrelevant).
- Compile all hit ‘Play’ and start clicking
In case this is intended behavior I wonder how/if I can get the old behavior back.