0

The server is always using Keyboard and Mouse just fine.

The client however always use "xbox controller" instead of Keyboard & Mouse:

The following is the inspector view as a client:

enter image description here

The Start Asset input action are unchanged, enter image description here

This is what I tried but client is still being assigned to controller:

private void Start()
{
    if (!IsOwner)
    {
        Destroy(GetComponent<PlayerInput>());
    }
}

How could I fix this? Other than hard coding (PlayerInput)map.SwitchCurrentControlScheme("KeyboardAndMouse");?

HardcoreGamer
  • 1,151
  • 1
  • 16
  • 24

1 Answers1

0

This issue is fixed by disabling Player Input script.

And only enable it on Network Spawn.

    public override void OnNetworkSpawn()
    {
        base.OnNetworkSpawn();
        if (IsOwner)
        {
            _playerInput = GetComponent<PlayerInput>();
            _playerInput.enabled = true;
        }
    }
HardcoreGamer
  • 1,151
  • 1
  • 16
  • 24