InputSystem_Warriors icon indicating copy to clipboard operation
InputSystem_Warriors copied to clipboard

Setting `Number of Players` to more than one with only one input device throws an error

Open bradweiers opened this issue 5 years ago • 2 comments

The following error is thrown per extra player.

ArgumentOutOfRangeException: Specified argument was out of the range of valid values. Parameter name: index UnityEngine.InputSystem.Utilities.ReadOnlyArray`1[TValue].get_Item (System.Int32 index) (at Library/PackageCache/[email protected]/InputSystem/Utilities/ReadOnlyArray.cs:117) UIMenuManager.UpdateRebindPlayerPanelList () (at Assets/Scripts/UIMenuManager.cs:34) GameManager.UpdateUIMenuPlayerList () (at Assets/Scripts/GameManager.cs:84) GameManager.SpawnPlayers () (at Assets/Scripts/GameManager.cs:79) GameManager.SetupActivePlayers () (at Assets/Scripts/GameManager.cs:47) GameManager.Start () (at Assets/Scripts/GameManager.cs:30)

bradweiers avatar Mar 10 '20 06:03 bradweiers

This is generally 'by design' as the spawn logic is a simple For loop Instantiate.

However, I should probably add a toggle for setting an automatic number of warriors to spawn based on number of plugged in devices. Ill leave this issue open until i've done that. :)

andytouch avatar Apr 15 '20 14:04 andytouch

I've got the same behaviour as described by @bradweiers

But if I do have multiple controllers connected, only one is used to controll a warrior and the other warrior is controlled by the keyboard.

How do I controll two warriors each with a controller?

simonbroggi avatar May 10 '21 11:05 simonbroggi