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 /
  • Help Room /
avatar image
3
Question by TrollInSecret · Feb 16, 2020 at 10:39 AM · input

How to control aixs gravity, sensitivity in new Input System

Hi I'm trying to use new input system.

I found that in the new system the axis input does not support gravity or sensitivity at basic setting.

but i want to control gravity or sensitivity like old version.

How can i solve this problem.

thank you

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

4 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by CheekiBreekiBradenski · May 01, 2020 at 09:38 AM

Hi @TrollInSecret , I believe this is done through the GUI in your InputActionSystem. Navigate to the relevant binding and add a processor (scaling, inversion deadzone etc). So to change the sensitivity you will change the scaling of the Vectors or whatever option it provides you with, and it seems to work as a fractional value. I hope this helps you or at least gets you close to the right answer.

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 Jordan24 · May 03, 2020 at 03:20 AM 2
Share

I have the same question as @TrollInSecret above and just tried your suggestion. The scale option didn't have the desired effect of dropping the input smoothly from 1 to 0 over a fraction of a second (for gravity or vice versa for sensitivity) but merely multiplied the input by the scale (e.g. with a scale of 10, my character moved 10 times as fast and a scale of .1 moved a tenth as fast). The Processor menu does seem to be the logical place to find sensitivity and gravity, but the Scale processor was not the equivalent. Please correct me if I am wrong and simply didn't follow your instructions correctly.

avatar image
1

Answer by Nickp2905 · Jun 29, 2020 at 12:00 PM

Hi, I was looking at the same problem.
Under the 'Processors' for a 'Left Stick [Gamepad] I added, a 'Scale Vector 2' processor. Then set X to the value of 20 and Y to the same value. Saved the asset and retried my gamepad controller, and the look rotation was vastly improved. This had no effect on my mouse controller. Regards, Nick

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 frostfromwayback · Feb 20, 2021 at 07:11 AM

https://answers.unity.com/questions/1699430/how-can-i-apply-sensitivity-in-new-input-system-fo.html

This solution uses Mathf.MoveTowards(...) to achieve this. The scaling needs to be done on the input relative to time, so scaling in the editor doesn't seem to work. Would be interested if there's an alternate way that Unity considers best practice...

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 Wollbobaggins · Mar 09, 2021 at 07:41 PM 0
Share

This seems like such a silly work around, I'm really surprised they don't have a gravity option under processors. To address the "scaling relative to time" problem you mentioned, you could use Time.fixedDeltaTime rather than just deltaTime so it's universal across systems; however, it still seems like a band-aid solution... Either way, thanks for the tip! This got my desired result.

avatar image
0

Answer by Wollbobaggins · Mar 09, 2021 at 08:13 PM

this was the solution I used, adding input gravity, inspired by @frostfromwayback. PrepareControlsInput() is called within the update/fixed update Unity method

 [SerializeField, Range(0f, 100f)] float inputGravity = 10f;

 Controls controls;
 private Vector2 controlsInput;
 private Vector2 deltaInput;

 // other code...

 private void GetControlsInput(InputAction.CallbackContext ctx)
 {
     controlsInput = ctx.ReadValue<Vector2>();
 }
 
 private void PrepareControlsInput()
 {
     // input gravity
     deltaInput.x = Mathf.MoveTowards(
         deltaInput.x, controlsInput.x, Time.fixedDeltaTime * inputGravity
     );
     deltaInput.y = Mathf.MoveTowards(
         deltaInput.y, controlsInput.y, Time.fixedDeltaTime * inputGravity
     );
 
     // input clamped normalization
     deltaInput = Vector2.ClampMagnitude(deltaInput, 1f);
 }
 
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

226 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 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

PointAndClick 1 Answer

How use ANDROID NAVIGATION BUTTONS 0 Answers

Touch Controls without virtual joystick 0 Answers

how can i touch the fast objects ? 1 Answer

i need help making a dash ability for my endless runner game 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