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
3
Question by Pooky · Sep 22, 2010 at 03:47 PM · inputinputmanagerxbox360

Triggers on the 360 controller treated as one axis?

Hi, I've found that I can detect if the triggers on the 360 controller are pressed by looking at the joypad axis value for the 3rd axis on the joypad, however it does not work very well.

The value returned ranges from -1 to 1. If it is one the the right trigger is pressed, if it is -1 the left trigger is press. If no triggers are pressed or both triggers are pressed then the value returned will be zero.

This is no good as it is impossible to tell if both triggers are press or if neither of the triggers are pressed.

Is there a solution to this problem?

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

3 Replies

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

Answer by MOrlando · Feb 01, 2012 at 09:13 PM

In case anyone has problems with this on the Xbox360, you can use Axis 9 for the left trigger and Axis 10 for the right trigger. They both go from 0-1, of course, but you can access them individually. I haven't actually tested this on PC yet.

You can still access them together using Axis 3 in case you wanted to use them for brake and acceleration like Microsoft intended.

Also, I'm using 3.4.2f2 so it's possible I'm coming into this so late that the guys over at Unity already addressed this and I'm simply regurgitating that here.

Comment
Add comment · Show 2 · 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 Skjalg · May 30, 2012 at 03:56 PM 0
Share

I found it to be axis8 and axis9 (zero indexed), but you are correct and saved my day. Thank you kind sir :)

avatar image NewPersona · May 05, 2013 at 09:29 AM 0
Share

Thanks man, you helped me out.

avatar image
0

Answer by Maltus · Jan 19, 2011 at 04:38 PM

Well what I have done is set up one Input named trigger on axis 3 then invert it and now my left trigger is [0 to -1]and the right trigger is [0 to 1] if that helps.

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 tylo · Mar 16, 2015 at 11:22 PM 0
Share

Unfortunately this doesn't help if you need to hold down both triggers at once. It 'zeros out'.

avatar image
-1

Answer by alexnode · Sep 22, 2010 at 05:02 PM

I thought that the triggers were half axis from 0 to 1 not from -1 to 1 a.

edit ... http://answers.unity3d.com/questions/581/what-are-all-the-joystick-buttons-for-an-xbox-360-pc-controller

here it says that it might be a bug .... forum

Comment
Add comment · Show 2 · 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 Pooky · Sep 23, 2010 at 08:46 AM 0
Share

So how should I be polling for input from the 360 controller's triggers?

What settings should I have in the input manager?

From my experimentations I have only managed to detect the 360 controller triggers using:

Type: Joystick Axis Axis: 3rd axis

However this suffers from the problems described above :(

avatar image alexnode · Sep 23, 2010 at 04:04 PM 0
Share

i haven't fix the triggers my self ... so i used other keys ins$$anonymous$$d .. i don't remember exactly what was the problem for me but i stuck in something similar ..

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

2 People are following this question.

avatar image avatar image

Related Questions

Remote user game pads stuck on X axis, locally fine. 1 Answer

how can I assign and use different controller schemes for a single keyboard? 0 Answers

How do I get the name of a Joystick by its number? 1 Answer

Supplying Input from Update To FixedUpdate 1 Answer

Creating an input manager that supports axis 0 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