Hello,
I’m getting the following error on this line of code and can’t figure out why:
GetComponent<PlayerInputManager>().JoinPlayer(-1, -1, "Keyboard&Player");
It says it can not find the controller’s action but I don’t even try to join player by gamepad (A gamepad is in deed connected)
*Edit: I fixed it by switching the PlayerInputManager’s behavior to “Send messages” instead of Unity Events, implemented this method public void OnMove(InputValue value) {}
and it now works without any error.
Cannot find action ‘Player/MoveAxis[/XInputControllerWindows/leftStick]’ with ID ‘53ca1077-7ceb-4d51-8d6a-e0a61f293aa2’ in 'PlayerInputActions (UnityEngine.InputSystem.InputActionAsset)
UnityEngine.InputSystem.PlayerInputManager:JoinPlayer(Int32, Int32, String, InputDevice)
LocalMultiplayerManager:SpawnFirstPlayer() (at Assets/_Scripts/Game/LocalMultiplayerManager.cs:17)
…
*Edit:
The odd thing is that the error says “action 'Cannot find action 'Player/MoveAxis…”. And at this moment Player/MoveAxis was already deleted hours before.