I’m working on a top down game, and when I’m using a gamepad, I need the mouse cursor to be completely disabled, besides hidden. like mouse over events can’t be triggered or anything.
How can i do so in blueprints?
I’m working on a top down game, and when I’m using a gamepad, I need the mouse cursor to be completely disabled, besides hidden. like mouse over events can’t be triggered or anything.
How can i do so in blueprints?
The mouse is handled by the OS, and Unreal naturally listens to the mouse (on PC at least though XBox and PlayStation do have mouse support, and I am not entirely sure how that is interpreted)
it is up to your program if something interacts with the mouse.
this might be a case of “are you asking the right question?”
I am guessing that you are designing the game to be able to switch between Keyboard+Mouse and Gamepad, and would like to have contextual interaction based on if either a gamepad is detected or if the most recent input was from the gamepad.
Which would mean the most effective search/title would be “How can I detect what the current input method is?”
if you are using Engine version 5.3 or later you can use “Input Device Subsystem” which is exposed to blueprints. Detect input device - #5 by yourboypavs which you can use to override the mouse state and runes for your program.
another method is to have separate input Action functions/events for Keyboad+mouse and Gamepad which set some state variable when their first action is to override mouse state, and change runes.
+1 to the above post.
i’d add that this is a nice usage for input mapping contexts, where you can have an IMC for joystick and another for kb+mouse. and add/remove dynamically. that’d be the closest to having the mouse sending no events at all (as long as you use those imcs for input and no other methods).
you can also put priority on those imcs, so you could even have an imc that overrides your other imcs.
i use that on my game to use the same inputs (e.g. mouse) for different actions depending on what’s shown on screen (e.g. dialog, inventory, menu).
You see, I’m outlining interactable actors on mouse over, and when I’m using a gamepad, I wanted to disable these mouse over interactions, without having to manually add a bool to every interactable actor:
however this didn’t work
it hides the mouse cursor, sets input mode to game only, but mouse over functions still work. if I was to move the character with a gamepad, the invisible mouse cursor would still go over interactable objects and outline them
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.