I’m trying to set up a system for the player to be able to switch input methods between Mouse/Keyboard and Controller. Most of it is working except that in most of the instances where I switch to Controller, the Cursor doesn’t seem to disappear. I’ve been using the Set Show Mouse Cursor node as well as the Set Cursor node, as recommended in this thread, but without much luck. I’ve even tried two versions of the “set Cursor” node for good measure (by good measure I mean I’ve been getting desperate and trying everything). the following image is from a function UpdateFocus that gets called each time CommonInput detects that the input method has changed, as well as when a menu is opened. The print statement at the end confirms the code is getting called, but the cursor still sticks around.
Ideally, I’d like to get the cursor to disappear in my UpdateFocus function. I also have a point where I (try to) hide it upon exiting the menu. This works, but only when exiting the menu with mouse/keyboard. If the player switches to Controller while in the menu, then exits out, the cursor continues hovering over the gameplay. The Player can still move the mouse, which then moves the camera below it. Functionality gets even further broken when the player tries to click, the camera no longer follows the mouse unless the player holds down the click button. The Cursor does disappear while the player is holding the mouse, leading me to believe it’s related to my usage of the “set input mode game and UI” node, wherein I have “hide cursor during capture” set to true. However I should be setting back to input mode game only when I hide menu. This is another place where I’m trying to dismiss the mouse cursor through Set Cursor and Set Show Mouse Cursor, but to no avail. Once again, the print statement is being called, so I know it’s not just an issue with the code being called. For whatever reason it’s just not properly dismissing the cursor when it does so.
I was using the Set Input Mode… nodes prior to encountering this issue, but I have double checked This behavior after seeing a few other forum posts recommend Using Set Input Mode Game Only. As far as I can tell I’m doing the correct swaps everywhere I should be doing so.
The only other possible cause for this issue I can conceive of would be that I’m accidentally re-setting something about the cursor? Such as setting “show Cursor” to true in a completely different class at the same time that I’m trying to hide it. However I’ve pored through my code pretty extensively to check this isn’t the case. I mentioned double checking the Set Input Modes, I’ve also checked for all references to “Set Show Mouse Cursor” and “Set Cursor”. Using the Find in blueprints feature to identify each point the nodes are used, and using breakpoints and print statements to verify they’re not accidentally getting called when I’m trying to hide the mouse. If there are other nodes I should try looking for I’m open to suggestions. But overall I suspect this is a deeper issue with something I’m not understanding about the functionality, or even a continuation of this forum, suspecting it to be a bug with unreal, rather than just spaghettified UI code.