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
0
Question by Conect11 · Feb 09, 2018 at 10:46 PM · javascriptinputmanagersensitivity

Changing input sensitivity via scripting (JS)

This.feels.so.noob.

Ok, so I already Google'd this, and didn't get an answer I'm satisfied with, that's why I'm bringing it here.

Here's my problem:

I have a menu script that utilizes the "Vertical" key. (currently testing on keyboard input) In order for the highlighted selection to not always go to the top choice I changed the sensitivity in Unity Input Manager to 0. Works like a charm. EXCEPT that once in game the player won't stop walking. So I set sensitivity back to 3, the default. Works like a charm, EXCEPT now in aforementioned menu script the highlighted text snaps back to the top selection. (Bear in mind that ALL of this has occurred in the editor. No changes were made via script. So my question is this: can I change input sensitivity via script during the game? I really like that setting for each intended use, but am not sure if it can be done. Thanks for any help.

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 hexagonius · Feb 09, 2018 at 11:17 PM 0
Share

I don't think it should be necessary to change the sensitivity. you're talking about a character which is moving depending on input, with the accelerating from it and all, and a menu, where usually one key tab would mean selecting just the next menu entry. maybe with some holding time for swooshing about the entries.
my question is, how are you changing menu entries that allow for reaching straight for the top.

avatar image Conect11 hexagonius · Feb 10, 2018 at 05:02 AM 0
Share

Think of the menu as an A / B question. It's actually part of character selection at the beginning of the game. The player is asked a question, and then has their choice of one of two possible answers. So, with sensitivity set to 0 they can move the highlighted text between the two answers and the text will stay highlighted until they choose to move the selection. Unfortunately, having the the sensitivity set that way means that once in game the player will continue to walk (or run) once that input key (vertical) is pressed once. The solution kind of would look like this:

$$anonymous$$enu: Sensitivity = 0 (keeps highlighted text from moving)

In Game: Sensitivity = 3 (keeps player from moving when button / key is released)

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by YaserDev · Mar 02, 2018 at 03:05 PM

You can declare another "sensitivity" variable in either your menu highlighting script or player movements script, then multiply the value you get from Input.GetAxis("Vertical") with that sensitivity variable. Currently, you can't change the variables of the InputManager from a script, Unity team is actively working on a new Input system that will probably have this feature.

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

119 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

Related Questions

How to make a mouse sensitivity slider? 1 Answer

Setting Scroll View Width GUILayout 1 Answer

Keep crouched until button pressed again? Javascript provided 1 Answer

guitexture to act as a button on the keyboard or mouse 0 Answers

Can someone help me fix my Javascript for Flickering Light? 6 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