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
0
Question by ChronosMOT · Jan 03, 2014 at 10:21 PM · inputcontrollergetaxisxbox360

different behaviour of axis using xbox360 controller

I tried moving a cube to the values of "Horizontal" and "Vertical", and it worked with the standard settings. But the movement seemed to be restricted by a circle, while key input is restricted by a square.

I then changed the settings in the "key axis" to accept controller input and deleted the preset "controller axis". The result was a square restriction.

My question is why? I don't see any setting that could have this effect.

Thanks for the help

P.S: I really didn't know how to put this in one sentence for the headline. Sorry for the mess

Comment
Add comment · Show 1
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 ChronosMOT · Jan 03, 2014 at 10:24 PM 0
Share

Here is the code I'm using to move the cube

   void Update () {
     transform.position = new Vector3(Input.GetAxis("Horizontal"), Input.GetAxis("Vertical"), 0);
   }

1 Reply

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

Answer by Leosori · Jan 04, 2014 at 06:38 PM

It's a design choice. You have circle with radius = 1, so you are getting a vector with a max. length of 1 in all directions. If you push the stick into a 'corner' you will get a vector like (~0.7, ~0.7) which has the length 1.

There a some gamepads and joysticks who will report (1, 1) in a corner, so depending on your application you may need to check for that.

The reason you are seeing a different behavior, if you change the predefined keyboard axes to joystick input, is that the sensitivity setting is pushing the real value towards the target value of +/- 1. For joysticks the default value is 1, but for keyboard it is 3. So you reach +/- 1 already with one third of movement with your stick.

Comment
Add comment · Show 3 · 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 ChronosMOT · Jan 06, 2014 at 12:49 AM 0
Share

that would make sense to me as well, but that's not happening. both times I used my xbox 360 controller the one way i got (~0.7, ~0.7), the other I got (1,1). That's what got me confused.

Same controller -> different results

Sorry if this wasn't clear

avatar image Leosori · Jan 06, 2014 at 11:22 AM 0
Share

ah, I skipped that part of your question. I just tested it myself and I can see the same behavior. The sensitivity setting is set to 3 for keyboard input and 1 for joysticks. It pushes the real value towards the target value. If you set it to 3, you can see that you reach +/- 1 with just a little movement of your stick, so you can still reach +/- 1 in the corners too.

I have added this part to my previous answer.

avatar image ChronosMOT · Jan 06, 2014 at 03:53 PM 0
Share

didn't notice that. Thank you

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

19 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

Related Questions

How do I use an Xbox controller axis other than the left thumbstick? 0 Answers

Multiple x360 controllers get wrong IDs assigned. 2 Answers

Can't get Triggers to Work [Solved] 1 Answer

GetButtonDown not responding to Xbox 360 Button presses 0 Answers

Please help me set up my inputs. Im pretty confused. 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