Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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 RealMTG · Mar 02, 2015 at 06:39 PM · triggerxboxcontroller

Xbox controller triggers for Input Mangaer

Hi

I am trying to get the triggers to work on my xbox controller so I can use them to use my attacks in my game. I have heard that they are axis and I have tried putting in all this like joystick axis , axis e.t.c but nothing works. So how can I make so my primary attack uses the right trigger and my secondary attack uses the left trigger?

Thanks in advance!

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 steakpinball · Mar 02, 2015 at 07:15 PM 0
Share

The triggers are indeed axes. I'm not sure which they are since I always use the InControl plugin for controllers.

1 Reply

· Add your reply
  • Sort: 
avatar image
18

Answer by curiouspers · Mar 03, 2015 at 03:12 AM

Go to Edit - Project settings - Input Create new element, set the name to PrimaryAttack, or whatever you want, select type Joystick Axis, Axis - 9th axis, Joy num - 1st or Get motion from all Joysticks. Positive, negative and alt buttons should be empty, gravity and sensivity - 1000, Dead around 0.2, snap must be ON (this way you will always get only 1 or 0 values, but not between them, like 0.5.

Then in your code you did this:

 float primaryAttack = Input.GetAxis ("PrimaryAttack");

And if it's not 0 - make your attacking code.

Repeat all the above steps for SecondaryAttack, but use 10th axis.

OR you may use 3rd axis for both of your attacks, but you will get value from -1 (left trigger) to 1 (right trigger)

Also check this article, because there are some differences between OSes: http://wiki.unity3d.com/index.php?title=Xbox360Controller

For different OSes you may create several items in input setting with same names, say PrimaryAttack for each OS (3 of them with different axises for each - win, mac and linux).

Hope this will help.

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 benwrightdesign · Nov 14, 2019 at 11:51 AM 0
Share

This was a life-saver. 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

24 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

Related Questions

Can't click gameobject when over another trigger? 1 Answer

How to get individual trigger input using Xbox 360 controller? 3 Answers

How to get trigger input on an Xbox controller (Mac) 0 Answers

How can I get trigger input from an Xbox controller? (Mac) 0 Answers

How can I get trigger input from an Xbox controller? (Mac) 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