Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
4
Question by Varrenth · Mar 17, 2020 at 10:10 PM · inputmissingmethodexception

Problem with new Input System Error when using interaction

Hello All. I am trying to fight the problem for two days but until now I was unable to find a solution. Here is the error which I am getting:alt text

I am using new Input System. I have made all the steps according to the official guide. Here is my setupalt text

And here is my code:

 using UnityEngine;
 using UnityEngine.InputSystem;
 
 public class Movement : MonoBehaviour, Loco.IPlayerActions
 {
 
     InputAction pickup;
     Loco controls;
 
     private void OnEnable()
     {
         if (controls == null)
         {
             controls = new Loco();
             controls.Player.SetCallbacks(this);
 
         }
         controls.Player.Enable();
         pickup = controls.Player.PickUp;
 
         pickup.started += _ => { Debug.Log("Started"); };
         pickup.performed += _ => { Debug.Log("Performed"); };
 
     }
 
     public void OnMove(InputAction.CallbackContext context)
     {
       
     }
 
     public void OnPickUp(InputAction.CallbackContext context)
     {
        
     }
     private void OnDisable()
     {
         controls.Player.Disable(); 
     }
 }


Error appears only if I hold a button longer than given Hold time. Does anyone has any idea what is wrong?

error.png (52.2 kB)
input-actions.png (106.5 kB)
Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

3 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by aoikishu · Apr 25, 2020 at 12:56 AM

From my trial and error, I believe the parameter should be

  • CallbackContext when the Player Input's Behavior is set to "Invoke Unity Events"

  • InputValue when the behavior is "Broadcast/Send Messages".

Give this a try:

 public void OnPickUp(InputValue value)
 {
         
 }

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
1

Answer by paulq · Mar 23, 2020 at 01:03 AM

Try removing or renaming your OnMove() and/or OnPickup() functions to something else. I had the same problem when trying to add functions named OnMove() and OnFire() to the "performed" InputActions for Move and Fire. Simply renaming them to OnMoveX() and OnFireX() had everything working as expected, although I don't know the reason for this.

Maybe someone else can give an explanation?

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Flying_Banana · Jul 20, 2021 at 07:19 PM 0
Share

Might be because those function names are reserved in Unity. Good observation though, this fixed my problem!

avatar image ZMilla · Aug 07, 2021 at 01:11 AM 0
Share

The exact reason is that the callback function cannot be named "On[ActionName]" regardless of what the action name is. ie If you name your action "WeirdAction", then you cannot name the callback "OnWeirdAction".

avatar image
0

Answer by Landough · Oct 16, 2020 at 09:08 AM

Did you ever find the solution to this? I'm having the same issue.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image chisomodoemenes · Oct 25, 2020 at 01:50 AM 0
Share

its what @aoikishu said that worked for me.

Add public void On$$anonymous$$ove() then it works

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

155 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Help In Making a SphereCast for 3D Tire! Working RayCast Script included! 0 Answers

I know it says be specific but what the actual hell is this ? 2 Answers

What Input Settings should I use for "Window Movements X-Y" for Android Tablet such: "I-INN SPOCK-M87V", that have a 3 axis gyroscope? 0 Answers

SteamVR and Unity input systems conflict 0 Answers

Trigger 'if' statement while in TextField 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges