Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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
1
Question by jfarzan · Jul 15, 2013 at 09:52 PM · inputinputmanager

How to add custom input to InputManager?

I'm making a gesture based game with Omek and Unity, but I'm having trouble figuring out how to add different input methods to the InputManager. Any help?

EDIT I really should have been more specific with my issues, and I apologize for that. I'm attempting to use the CharacterController to move my player piece around, but this only takes input from the InputManager, which by default only uses joysticks or mouse/keyboard. I'm wondering if there's a way that I could add gestures (aka add some outside input source) to that, or if I'm better off not using the Controller like I've been doing.

Comment
Add comment · Show 3
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 Benproductions1 · Jul 16, 2013 at 02:30 AM 0
Share

"I want to make a racing game! Please help me." With that attitude and the little detail, why should I?

avatar image jfarzan · Jul 16, 2013 at 01:06 PM 0
Share

I'm sorry if I wasn't specific enough, I posted this at the end of a long day and was a bit frustrated by the issues, so I will revise and add more detail.

avatar image AlucardJay · Jul 18, 2013 at 10:54 AM 0
Share

If you are looking to support multiple builds and devices, you should have a look at some examples on how different inputs are controlled.

From the Unity Wiki, check the Update method, where it checks if running in editor then use mouse inputs (else use touch) : http://wiki.unity3d.com/index.php/Tap_to_$$anonymous$$ove_Drag_to_Look_iPhone

This is Platform Dependent Compilation : http://docs.unity3d.com/Documentation/$$anonymous$$anual/PlatformDependentCompilation.html

A more thorough test case would be angry bots. Check the Player$$anonymous$$oveController script :

 // ....
 
 #if UNITY_IPHONE || UNITY_ANDROID
     if (joystickPrefab) {
         // ....            
     }
 #elif !UNITY_FLASH
     if (cursorPrefab) {
         // ....
     }
 #endif

     // ....
 
 // HANDLE CHARACTER $$anonymous$$OVE$$anonymous$$ENT DIRECTION
     #if UNITY_IPHONE || UNITY_ANDROID
         motor.movementDirection = joystickLeft.position.x * screen$$anonymous$$ovementRight + joystickLeft.position.y * screen$$anonymous$$ovementForward;
     #else
         motor.movementDirection = Input.GetAxis ("Horizontal") * screen$$anonymous$$ovementRight + Input.GetAxis ("Vertical") * screen$$anonymous$$ovementForward;
     #endif

2 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Benproductions1 · Jul 17, 2013 at 01:40 AM

Unity's Input manager only takes input from supported devices. It also doesn't allow you to change anything at runtime.
If you want either of thes features, you will need to manually add them yourself

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 jfarzan · Jul 17, 2013 at 02:59 PM 0
Share

How would I manually add them?

avatar image Benproductions1 · Jul 18, 2013 at 10:31 AM 0
Share

$$anonymous$$ake your own Impot$$anonymous$$anager, that handles the hardware input, probably though a dll. For instance, with XBox controllers, it's the XInput API that you need.

avatar image
0

Answer by Mill0698 · Jul 16, 2013 at 03:59 AM

If you are talking about the number of parameters the input manager takes in, just change the 'Size' Number. Input Manager

Comment
Add comment · 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

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

18 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

Related Questions

How do I get the name of a Joystick by its number? 1 Answer

Supplying Input from Update To FixedUpdate 1 Answer

Creating an input manager that supports axis 0 Answers

how can I assign and use different controller schemes for a single keyboard? 0 Answers

Why does InputManager have multiple axes with the same name? 1 Answer


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