Hi, I implement new input system using events and everything was cool, until I tried use my Xbox Series controller, camera rotation with stick has much less frequency.
Here I generate C# class in Input Action asset, and inherited interface from it. In OnLook method I just rise event to tell MouseLook class new input data and current input device:
public static event Action<Vector2, InputDevice> Look;
public void OnLook(InputAction.CallbackContext context)
{
Look.Invoke(context.ReadValue<Vector2>(), context.control.device);
}
And in MouseLook I just subscribe to OnLook event and handle event:
InputManager.Look += MouseMove;
private void MouseMove(Vector2 mouseDelta, inputDevice InputDevice)
When I move mouse, camera rotate perfectly, but gamepad has a serius lag. I wrote event counter and get that results: mouse move rise OnLook event 700-800 times per second, stick - only 20 times.
BUT, when I read input in Update, like before, gamepad works well.
So question: I made mistake in code or input can’t be handled by events?