Hi all–trying to use this new input system, but running into constant roadblocks, hoping maybe someone can shed some light on this behavior.
Basically, I have an action map that has a single action that has two bindings–one is the raw mouse position and the other is a composite vector2 comprised of the WASD keys (pretty standard.)
My callback looks like this:
public void Input_CameraPan(InputAction.CallbackContext context)
{
if (context.performed)
{
Debug.Log(context.control);
_panAmount = context.ReadValue<Vector2>();
}
}
That’s it. Nothing fancy, literally just reading a Vector2. What I am expecting to happen is for the mouse position to be returned if you move the mouse, and a Vector2 comprised of the w,a,s,d (all bound to their correct directions) to come back if any of those keys are pressed. Super simple.
Here’s what happens instead: if I don’t move the mouse at all, the W,A,S,D keys are properly ‘performed’ and I see the context.control output the correct key that was pressed. However, the moment I move the mouse, the W,A,S,D keys no longer trigger the callback function. Doesn’t matter if it’s outside the context.performed or not, it just doesn’t register any keypresses after I’ve moved the mouse once.
Does anyone have any idea how to get this to report both the mouse position AND any of the keyboard keys being pressed? I thought the entire purpose of this was to basically perform the same action regardless of where the input comes from, but seeing as the input isn’t detected properly, the action to be performed is somewhat moot. Thanks!