How to remove input delay of UI button and OnInput?

Options
Halluvision
edited January 2023 in Fusion

Hi there. I discovered a lag between OnInput calls and UI button pressed which cause my character jump feel unresponsive. As what I read on docs I wrote my code like this:

private void OnJumpClicked()
{
    Debug.Log("Action:" + Time.timeAsDouble);
    _data.Buttons.Set(InputButton.JUMP, true);
}

public void OnInput(NetworkRunner runner, NetworkInput input)
{
    if (_data.Buttons.IsSet(InputButton.JUMP))
    {
	Debug.Log("OnInput" + Time.timeAsDouble);
    }
    input.Set(_data);
    _data = default;
}

There is always a simulation time delay between Action and OnInput. So is there anyway to remove this and make it responsive?

PS: I changed the code and checked if my UI button is pressed and this removed the lag. Actually there was a problem that my character would not climb slopes in android build so after changing this that problem goes away too.