Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Callback Context missing method exception

Discussion in 'Input System' started by Encounter4592, May 5, 2023.

  1. Encounter4592

    Encounter4592

    Joined:
    May 3, 2023
    Posts:
    5
    Hello,
    When I use InputValue instead of InputAction there's no error. I have read the documentation, but still don't get why the callback context doesn't work; explanation would be really helpful. The naming is alright, and the object has the input settings attached.

    Code (CSharp):
    1.     public void OnAim(InputAction.CallbackContext context)
    2.     {
    3.         // Update the aim direction
    4.         _aimDirection = context.ReadValue<Vector2>();
    5.     }
    Code (CSharp):
    1. MissingMethodException: Method 'RangedCombatSystem.OnAim' not found.
    2. System.RuntimeType.InvokeMember (System.String name, System.Reflection.BindingFlags bindingFlags, System.Reflection.Binder binder, System.Object target, System.Object[] providedArgs, System.Reflection.ParameterModifier[] modifiers, System.Globalization.CultureInfo culture, System.String[] namedParams) (at <e40e5a8f982c4b618a930d29f9bd091c>:0)
    3. UnityEngine.SetupCoroutine.InvokeMember (System.Object behaviour, System.String name, System.Object variable) (at <4a31731933e0419ca5a995305014ad37>:0)
    4. UnityEngine.InputSystem.LowLevel.<>c__DisplayClass7_0:<set_onUpdate>b__0(NativeInputUpdateType, NativeInputEventBuffer*)
    5. UnityEngineInternal.Input.NativeInputSystem:NotifyUpdate(NativeInputUpdateType, IntPtr)
    Thanks!