Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 mimatos · Dec 10, 2010 at 04:55 PM · changedefaultkeys

Change WADS to custom Keys through script

I am wonder if it is possible to change the input keys used from their default WADS setting to new custom keys through code rather then using the input manager. If so how can I accomplish this?

Comment
Add comment · Show 2
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 Justin Warner · Dec 10, 2010 at 05:05 PM 0
Share

$$anonymous$$ake your own inputs... In Unity:

  1. Edit

  2. Project Settings

  3. Input

  4. Check out Unity has it, but make it for your own (Name your axis and what not).

Should help out.

avatar image skovacs1 · Dec 10, 2010 at 05:18 PM 0
Share

@Justin Warner: That's still done through the Input $$anonymous$$anager and does not help because that's what the op is trying to avoid.

2 Replies

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

Answer by skovacs1 · Dec 10, 2010 at 05:12 PM

No. I do not believe that you can change the virtual buttons defined in the Input Manager through code. You would have to either change them in the Input Manager in the editor, provide the Configuration Dialog or define your own setups using the specific keys, etc.

One way to do your own setup for configurable buttons or axes is to define an Enum or array of key identifiers which somehow(your choice) map to the key names used by GetKey and then store the key string in a variable whenever you set it and when checking input, use Input.GetKey(keyString). Wherever in code that you need to change the key, you merely change this string variable and it just works. This is essentially a virtual button and you can setup all sorts of other settings for damping and sensitivity and whatever to emulate GetButton or GetAxis as you need, with the exception of Input Axes not defined by keys, which would have to be retrieved by button name.

Another option is to have several different buttons/axes defined in the Input Manager with different names. By controlling the value of a button/axis string in much the same way as above, you can change which Button or Axis that you want to use by simply changing the value of the string, Input.GetButton(buttonString); Input.GetAxis(axisString); and such.

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 mimatos · Dec 10, 2010 at 05:22 PM 0
Share

True, I was hoping this was possible but the more I think about it and review it I don't think it actually is. Thanks for your answer

avatar image
0

Answer by danielpaavola · Nov 22, 2015 at 05:50 PM

I'm not sure, so don't take my word for it, but I think you may be able to just make a different axis and just set the keys up differently and switch between the two axis.

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 danielpaavola · Nov 22, 2015 at 03:05 PM 0
Share

I've been working on making this work, but so far, I can't.

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

1 Person is following this question.

avatar image

Related Questions

Is there a way to "Apply" transformations on an object without simply attatching it to an empty gameobject? 1 Answer

Editing the Default GUISkin 1 Answer

My player returns to default position when pressing play 1 Answer

Changing controls in game, after application has launched 2 Answers

Changing the type of a variable 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