Hi all, currently using Unity 2021.2.17f1, building for PC, PS4, and Switch. We recently switched from InputSystem 1.3.0 to 1.4.2 in order to get a fix for a Dualshock 4 disconnect / reconnect issue. That specific issue is fixed, but now we get errors on all platforms when a player is removed from the game. These errors don’t exist in 1.3.0.
Type of instance in array does not match expected type
UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:Assert(Boolean, String)
UnityEngine.InputSystem.InputBindingResolver:InstantiateWithParameters(TypeTable, String, TType[]&, Int32&, InputActionMap, InputBinding&)
UnityEngine.InputSystem.InputBindingResolver:AddActionMap(InputActionMap)
UnityEngine.InputSystem.InputActionMap:ResolveBindings()
UnityEngine.InputSystem.InputActionMap:ResolveBindingsIfNecessary()
UnityEngine.InputSystem.InputActionState:smile:eferredResolutionOfBindings()
UnityEngine.InputSystem.DeferBindingResolutionWrapper:smile:ispose()
UnityEngine.InputSystem.PlayerInput:OnDisable()
After this, when attempting to add a player as usual via gamepad button press, we get:
ArgumentNullException: Value cannot be null.
Parameter name: source
at System.Linq.Enumerable.Contains[TSource] (System.Collections.Generic.IEnumerable`1[T] source, TSource value, System.Collections.Generic.IEqualityComparer`1[T] co
mparer) [0x00000] in <00000000000000000000000000000000>:0
at System.Linq.Enumerable.Contains[TSource] (System.Collections.Generic.IEnumerable`1[T] source, TSource value) [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.InputSystem.InputActionState.EnableAllActions (UnityEngine.InputSystem.InputActionMap map) [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.InputSystem.InputActionMap.Enable () [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.InputSystem.PlayerInput.set_currentActionMap (UnityEngine.InputSystem.InputActionMap value) [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.InputSystem.PlayerInput.SwitchCurrentActionMap (System.String mapNameOrId) [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.InputSystem.PlayerInput.ActivateInput () [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.InputSystem.PlayerInput.OnEnable () [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.Object.Internal_CloneSingle (UnityEngine.Object data) [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.Object.Instantiate[T] (T original) [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.InputSystem.PlayerInput.DoInstantiate (UnityEngine.GameObject prefab) [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.InputSystem.PlayerInput.Instantiate (UnityEngine.GameObject prefab, System.Int32 playerIndex, System.String controlScheme, System.Int32 splitScreenIn
dex, UnityEngine.InputSystem.InputDevice pairWithDevice) [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.InputSystem.PlayerInputManager.JoinPlayer (System.Int32 playerIndex, System.Int32 splitScreenIndex, System.String controlScheme, UnityEngine.InputSys
tem.InputDevice pairWithDevice) [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.InputSystem.PlayerInputManager.JoinPlayerFromActionIfNotAlreadyJoined (UnityEngine.InputSystem.InputAction+CallbackContext context) [0x00000] in <000
00000000000000000000000000000>:0
at System.Action`1[T].Invoke (T obj) [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.InputSystem.Utilities.DelegateHelpers.InvokeCallbacksSafe[TValue] (UnityEngine.InputSystem.Utilities.CallbackArray`1[System.Action`1[TValue]]& callba
cks, TValue argument, System.String callbackName, System.Object context) [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.InputSystem.InputActionState.CallActionListeners (System.Int32 actionIndex, UnityEngine.InputSystem.InputActionMap actionMap, UnityEngine.InputSystem
.InputActionPhase phase, UnityEngine.InputSystem.Utilities.CallbackArray`1[System.Action`1[UnityEngine.InputSystem.InputAction+CallbackContext]]& listeners, System.St
ring callbackName) [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.InputSystem.InputActionState.ChangePhaseOfActionInternal (System.Int32 actionIndex, UnityEngine.InputSystem.InputActionState+TriggerState* actionStat
e, UnityEngine.InputSystem.InputActionPhase newPhase, UnityEngine.InputSystem.InputActionState+TriggerState& trigger) [0x00000] in <00000000000000000000000000000000>:
0
at UnityEngine.InputSystem.InputActionState.ChangePhaseOfAction (UnityEngine.InputSystem.InputActionPhase newPhase, UnityEngine.InputSystem.InputActionState+Trigger
State& trigger, UnityEngine.InputSystem.InputActionPhase phaseAfterPerformedOrCanceled) [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.InputSystem.InputActionState.ChangePhaseOfInteraction (UnityEngine.InputSystem.InputActionPhase newPhase, UnityEngine.InputSystem.InputActionState+Tr
iggerState& trigger, UnityEngine.InputSystem.InputActionPhase phaseAfterPerformed, System.Boolean processNextInteractionOnCancel) [0x00000] in <0000000000000000000000
0000000000>:0
at UnityEngine.InputSystem.InputInteractionContext.PerformedAndStayPerformed () [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.InputSystem.Interactions.PressInteraction.Process (UnityEngine.InputSystem.InputInteractionContext& context) [0x00000] in <00000000000000000000000000
000000>:0
at UnityEngine.InputSystem.InputActionState.ProcessInteractions (UnityEngine.InputSystem.InputActionState+TriggerState& trigger, System.Int32 interactionStartIndex,
System.Int32 interactionCount) [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.InputSystem.InputActionState.ProcessControlStateChange (System.Int32 mapIndex, System.Int32 controlIndex, System.Int32 bindingIndex, System.Double ti
me, UnityEngine.InputSystem.LowLevel.InputEventPtr eventPtr) [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.InputSystem.InputActionState.UnityEngine.InputSystem.LowLevel.IInputStateChangeMonitor.NotifyControlStateChanged (UnityEngine.InputSystem.InputContro
l control, System.Double time, UnityEngine.InputSystem.LowLevel.InputEventPtr eventPtr, System.Int64 mapControlAndBindingIndex) [0x00000] in <000000000000000000000000
00000000>:0
at UnityEngine.InputSystem.InputManager.FireStateChangeNotifications (System.Int32 deviceIndex, System.Double internalTime, UnityEngine.InputSystem.LowLevel.InputEv
ent* eventPtr) [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.InputSystem.InputManager.UpdateState (UnityEngine.InputSystem.InputDevice device, UnityEngine.InputSystem.LowLevel.InputUpdateType updateType, System
.Void* statePtr, System.UInt32 stateOffsetInDevice, System.UInt32 stateSize, System.Double internalTime, UnityEngine.InputSystem.LowLevel.InputEventPtr eventPtr) [0x0
0000] in <00000000000000000000000000000000>:0
at UnityEngine.InputSystem.InputManager.UpdateState (UnityEngine.InputSystem.InputDevice device, UnityEngine.InputSystem.LowLevel.InputEvent* eventPtr, UnityEngine.
InputSystem.LowLevel.InputUpdateType updateType) [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.InputSystem.InputManager.OnUpdate (UnityEngine.InputSystem.LowLevel.InputUpdateType updateType, UnityEngine.InputSystem.LowLevel.InputEventBuffer& ev
entBuffer) [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.InputSystem.LowLevel.NativeInputRuntime+<>c__DisplayClass7_0.<set_onUpdate>b__0 (UnityEngineInternal.Input.NativeInputUpdateType updateType, UnityEng
ineInternal.Input.NativeInputEventBuffer* eventBufferPtr) [0x00000] in <00000000000000000000000000000000>:0
at UnityEngineInternal.Input.NativeInputSystem.NotifyUpdate (UnityEngineInternal.Input.NativeInputUpdateType updateType, System.IntPtr eventBuffer) [0x00000] in <00
000000000000000000000000000000>:0
UnityEngine.Object:Internal_CloneSingle(Object)
UnityEngine.Object:Instantiate(T)
UnityEngine.InputSystem.PlayerInput:smile:oInstantiate(GameObject)
UnityEngine.InputSystem.PlayerInput:Instantiate(GameObject, Int32, String, Int32, InputDevice)
UnityEngine.InputSystem.PlayerInputManager:JoinPlayer(Int32, Int32, String, InputDevice)
UnityEngine.InputSystem.PlayerInputManager:JoinPlayerFromActionIfNotAlreadyJoined(CallbackContext)
System.Action`1:Invoke(T)
UnityEngine.InputSystem.Utilities.DelegateHelpers:InvokeCallbacksSafe(CallbackArray`1&, TValue, String, Object)
UnityEngine.InputSystem.InputActionState:CallActionListeners(Int32, InputActionMap, InputActionPhase, CallbackArray`1&, String)
UnityEngine.InputSystem.InputActionState:ChangePhaseOfActionInternal(Int32, TriggerState*, InputActionPhase, TriggerState&)
UnityEngine.InputSystem.InputActionState:ChangePhaseOfAction(InputActionPhase, TriggerState&, InputActionPhase)
UnityEngine.InputSystem.InputActionState:ChangePhaseOfInteraction(InputActionPhase, TriggerState&, InputActionPhase, Boolean)
UnityEngine.InputSystem.InputInteractionContext:PerformedAndStayPerformed()
UnityEngine.InputSystem.Interactions.PressInteraction:Process(InputInteractionContext&)
UnityEngine.InputSystem.InputActionState:ProcessInteractions(TriggerState&, Int32, Int32)
UnityEngine.InputSystem.InputActionState:ProcessControlStateChange(Int32, Int32, Int32, Double, InputEventPtr)
UnityEngine.InputSystem.InputActionState:UnityEngine.InputSystem.LowLevel.IInputStateChangeMonitor.NotifyControlStateChanged(InputControl, Double, InputEventPtr, Int6
4)
UnityEngine.InputSystem.InputManager:FireStateChangeNotifications(Int32, Double, InputEvent*)
UnityEngine.InputSystem.InputManager:UpdateState(InputDevice, InputUpdateType, Void*, UInt32, UInt32, Double, InputEventPtr)
UnityEngine.InputSystem.InputManager:UpdateState(InputDevice, InputEvent*, InputUpdateType)
UnityEngine.InputSystem.InputManager:OnUpdate(InputUpdateType, InputEventBuffer&)
UnityEngine.InputSystem.LowLevel.<>c__DisplayClass7_0:<set_onUpdate>b__0(NativeInputUpdateType, NativeInputEventBuffer*)
UnityEngineInternal.Input.NativeInputSystem:NotifyUpdate(NativeInputUpdateType, IntPtr)
We get the errors with 1.4.0, 1.4.1, and 1.4.2. We have reverted back to 1.3.0 for the time being but we’ll need the Dualshock 4 fix that 1.4.x addresses. I know there have been other bug reports submitted for 1.4.x but am not sure if this specific issue with removing / adding players is being addressed.