Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Input System giving errors on a brand new scene, but works on another one

Discussion in 'Input System' started by Follet, Jun 21, 2022.

  1. Follet

    Follet

    Joined:
    May 18, 2018
    Posts:
    38
    Hello,

    I have working perfectly the new Input System on one scene. Now I created a new one, and I get 4 errors related to one specific map, that does not allow me to use it at all. I have the references set the same (and zero errors on references), I use the event system with the new input system.

    The other inputs/actions work well (movement and camera), but the ones on the "Tap" and "Hold" actions I have don't. I also use the "OnEnable" to enable the control.

    This happens both with the version 1.0.2 and 1.3.0.

    The four errors I get are the following:

    1:
    ArgumentException: method arguments are incompatible
    System.Delegate.CreateDelegate (System.Type type, System.Object firstArgument, System.Reflection.MethodInfo method, System.Boolean throwOnBindFailure, System.Boolean allowClosed) (at <695d1cc93cca45069c528c15c9fdd749>:0)
    System.Delegate.CreateDelegate (System.Type type, System.Object firstArgument, System.Reflection.MethodInfo method) (at <695d1cc93cca45069c528c15c9fdd749>:0)
    UnityEngine.Events.InvokableCall`1[T1]..ctor (System.Object target, System.Reflection.MethodInfo theFunction) (at <9244fb8344e84288877b43b45b29c242>:0)
    UnityEngine.Events.UnityEvent`1[T0].GetDelegate (System.Object target, System.Reflection.MethodInfo theFunction) (at <9244fb8344e84288877b43b45b29c242>:0)
    UnityEngine.Events.PersistentCall.GetRuntimeCall (UnityEngine.Events.UnityEventBase theEvent) (at <9244fb8344e84288877b43b45b29c242>:0)
    UnityEngine.Events.PersistentCallGroup.Initialize (UnityEngine.Events.InvokableCallList invokableList, UnityEngine.Events.UnityEventBase unityEventBase) (at <9244fb8344e84288877b43b45b29c242>:0)
    UnityEngine.Events.UnityEventBase.RebuildPersistentCallsIfNeeded () (at <9244fb8344e84288877b43b45b29c242>:0)
    UnityEngine.Events.UnityEventBase.PrepareInvoke () (at <9244fb8344e84288877b43b45b29c242>:0)
    UnityEngine.Events.UnityEvent`1[T0].Invoke (T0 arg0) (at <9244fb8344e84288877b43b45b29c242>:0)
    UnityEngine.InputSystem.Utilities.DelegateHelpers.InvokeCallbacksSafe[TValue] (UnityEngine.InputSystem.Utilities.CallbackArray`1[System.Action`1[TValue]]& callbacks, TValue argument, System.String callbackName, System.Object context) (at Library/PackageCache/com.unity.inputsystem@1.3.0/InputSystem/Utilities/DelegateHelpers.cs:46)
    UnityEngine.InputSystem.LowLevel.<>c__DisplayClass7_0:<set_onUpdate>b__0(NativeInputUpdateType, NativeInputEventBuffer*)
    UnityEngineInternal.Input.NativeInputSystem:NotifyUpdate(NativeInputUpdateType, IntPtr)


    2:
    ArgumentException while executing 'started' callbacks of 'Normal/Tap[/Mouse/leftButton,/Keyboard/space,/Mouse/rightButton,/XInputControllerWindows/buttonSouth,/XInputControllerWindows/rightShoulder,/Keyboard/ctrl]'
    UnityEngine.InputSystem.LowLevel.NativeInputRuntime/<>c__DisplayClass7_0:<set_onUpdate>b__0 (UnityEngineInternal.Input.NativeInputUpdateType,UnityEngineInternal.Input.NativeInputEventBuffer*)
    UnityEngineInternal.Input.NativeInputSystem:NotifyUpdate (UnityEngineInternal.Input.NativeInputUpdateType,intptr)


    3:

    ArgumentException while executing 'performed' callbacks of 'Normal/Tap[/Mouse/leftButton,/Keyboard/space,/Mouse/rightButton,/XInputControllerWindows/buttonSouth,/XInputControllerWindows/rightShoulder,/Keyboard/ctrl]'
    UnityEngine.InputSystem.LowLevel.NativeInputRuntime/<>c__DisplayClass7_0:<set_onUpdate>b__0 (UnityEngineInternal.Input.NativeInputUpdateType,UnityEngineInternal.Input.NativeInputEventBuffer*)
    UnityEngineInternal.Input.NativeInputSystem:NotifyUpdate (UnityEngineInternal.Input.NativeInputUpdateType,intptr)

    4:
    ArgumentException while executing 'canceled' callbacks of 'Normal/Tap[/Mouse/leftButton,/Keyboard/space,/Mouse/rightButton,/XInputControllerWindows/buttonSouth,/XInputControllerWindows/rightShoulder,/Keyboard/ctrl]'
    UnityEngine.InputSystem.LowLevel.NativeInputRuntime/<>c__DisplayClass7_0:<set_onUpdate>b__0 (UnityEngineInternal.Input.NativeInputUpdateType,UnityEngineInternal.Input.NativeInputEventBuffer*)
    UnityEngineInternal.Input.NativeInputSystem:NotifyUpdate (UnityEngineInternal.Input.NativeInputUpdateType,intptr)
     
  2. Follet

    Follet

    Joined:
    May 18, 2018
    Posts:
    38
    I found in a different thread, old and not related at all, that for most "ArgumentException: method arguments are incompatible" the fix is destroying the gameobject where the issue is, create a new one and reassign everything.

    I had a "Game Manager" where my InputSystem was, I did a prefab of that one, and added it into the new scene. So Indeed, destroying it, creating a new one and reassigning a "new" input system into the new one fixed the issue.