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 jabez · Mar 05, 2014 at 01:35 AM · inputaxis

Reset Input.GetAxis Back to 0

Good'day, I'm having trouble finding a way resetting the Axis back to 0, I'm using Input.GetAxis ("Mouse X") to get it, is there any way to set this? any help would be greatly appreciated, thanks! - Jabez

Comment
Add comment · Show 5
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 robertbu · Mar 05, 2014 at 01:36 AM 0
Share

I think we need more context. If you don't move the mouse, Input.GetAxis("$$anonymous$$ouse X") should return 0.0.

avatar image jabez · Mar 05, 2014 at 01:51 AM 0
Share

Yes sorry. That's true, It returns to 0 on the computer, but on the android it has weird effect, I'm using it to control a ball left & right but when i release my finger off the screen & touch again it doesn't reset it. I think i'll just use the mouse position ins$$anonymous$$d of the axis. this is my script // Update is called once per frame void update () { h = Input.GetAxis("$$anonymous$$ouse X") ; rigidbody.AddForce (Vector3.right * h); } }

avatar image Eric5h5 · Mar 05, 2014 at 02:06 AM 0
Share

Use touch events on Android.

avatar image jabez · Mar 05, 2014 at 02:16 AM 0
Share

Thanks I shall look into it, i was trying to take the lazy way but as you know, the lazy way isn't the best way. The very first script on the script reference should do the trick with some tweaking. https://docs.unity3d.com/Documentation/ScriptReference/Input.GetTouch.html

avatar image Eric5h5 · Mar 05, 2014 at 02:43 AM 0
Share

The lazy way is usually good for quick prototyping, but yeah, not the best way. :)

0 Replies

· Add your reply
  • Sort: 

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

22 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

Related Questions

New Input axis with Numpad Keys 2 Answers

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

Creating an input manager that supports axis 0 Answers

How to get an axis without defining it in the InputManager 0 Answers

Problems with joystick / controller axes being 1/-1 "way too often" 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