So I’m new to this Input System and trying to create an action that occurs when the user presses, holds and releases the mouse (or touch screen).
I want to take the screen position of the input, convert it to normalized coordinates (-1, 1) and use that value in the “performed” callback. The goal of the action is to move the player left/right depending on where you press/touch on screen. It should also work with gamepads and keyboard as well.
Here I have a “Position [Mouse]” action that has a “Press and Release” interaction and a custom “Screen Input” processor to turn the position into the normalized coordinates.
But I never receive any started, performed, cancelled events. If I remove the “Press” interaction then I receive events, but every time the mouse moves, which is not what I want.
Can also see I have a game pad and keyboard sending “Move” commands as well. So I’d like to keep mouse position and touch position within the “Move” action.
Is this not possible? Is there a better/different way I should be doing this?
Ok, after looking at the internals a bit. This is the wrong approach. It’s not actually checking a press, rather, it considers a press if the mouse position magnitude < 0.5. In other words, 0.5 pixels from bottom left corner.