This is my input actions setting in UI map
The ScrollRect will only make small movements when I push the left stick continuously
It seems like the InputSytemUIInputModule only triggered when the input event is “performed”
So how do I get the ScrollRect to keep moving while I’m pushing the stick and not moving?
I found OnScrollCallback method in InputSystemUIInputModule class
private void OnScrollCallback(InputAction.CallbackContext context)
{
var index = GetPointerStateIndexFor(ref context);
if (index == -1)
return;
ref var state = ref GetPointerStateForIndex(index);
// The old input system reported scroll deltas in lines, we report pixels.
// Need to scale as the UI system expects lines.
state.scrollDelta = context.ReadValue<Vector2>() * (1 / kPixelPerLine);
#if UNITY_2022_3_OR_NEWER
state.eventData.displayIndex = GetDisplayIndexFor(context.control);
#endif
}
Since OnScrollCallback method will only be triggered on “performed” phase
So I change stick to D-pad to achieve similar results
The value of context.ReadValue() is about 100 when the mouse wheel is rolled,
so i scaled D-pad value by 100
This can achieve my effect approximately, but if anybody have a better solution on stick please let me know