• 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
Question by Face_Mcgace · Aug 13, 2014 at 03:38 PM · c#xboxcontrollerxbox360getbuttondown

Xbox Controller and Input.GetButtonDown( );

Hey there,

I've searched around for t$$anonymous$$s problem and couldn't find anyt$$anonymous$$ng on t$$anonymous$$s particular issue so sorry for a dupe if t$$anonymous$$s is one.

However, in our game when getting the controller input everyt$$anonymous$$ng works perfectly as long as the method is Input.GetButton. However, if the method is changed to Input.GetButtonDown() it suddenly stops working.

As sample of our code:

     public void Update( )
     {
         bool test = Input.GetButtonDown( "EBrake_1" );
         if( test )
         {
             Debug.Log( "Get Key Working" );
         }
     }

And the working code:

     public void Update( )
     {
         bool test = Input.GetButton( "EBrake_1" );
         if( test )
         {
             Debug.Log( "Get Key Working" );
         }
     }

I'm not too sure what the issue is, I've tried storing them in variables, calling them directly, etc. The only t$$anonymous$$ng I can t$$anonymous$$nk of is that the GetButtonDown method doesn't work with xbox one controller.

Comment
vladcom

People who like this

1 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 meat5000 ♦ · Aug 13, 2014 at 03:19 PM 0
Share

Make two boolean variables set to false.

On the first frame Button is detected make the A boolean true.

Detect this condition, including that the other, B, is false.

After this make B = A;

3 Replies

· Add your reply
  • Sort: 
avatar image
Best Answer

Answer by screenname_taken · Aug 13, 2014 at 03:44 PM

http://wiki.unity3d.com/index.php?title=Xbox360Controller

And use Input.GetKeyDown("joystick button 0")

Comment
vladcom

People who like this

1 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 Face_Mcgace · Aug 13, 2014 at 03:50 PM 0
Share

Yea that works fine, I'll just use that. But it does bother me a bit that the GetButtonDown doesn't work? Seems like a bug in Unity itself? In any case we will just use that. Thank you!

avatar image

Answer by 10yaseen1 · Jul 11, 2016 at 07:33 PM

Probably too late to reply, but I just tried changing my Input in input Manager to "Key or Mouse Button" instead of "Joystick Axis" and it works like a charm. :D

Comment
LukuluK
Tactical_Beard
petecantu
renation23
sayginkarahan

People who like this

5 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 renation23 · Aug 10, 2018 at 05:27 PM 0
Share

Well you just saved my life, I just went crazy because it worked with controller 1 and 2 but not with 3

avatar image sayginkarahan · Jan 09, 2019 at 04:47 PM 0
Share

thank you.

avatar image

Answer by ardiawanbagusharisa · Jan 30, 2018 at 06:38 AM

if anyone still has the same problem just follow t$$anonymous$$s wiki http://wiki.unity3d.com/index.php?title=Xbox360Controller edit > project settings > input > then follow the instructions from the site.

Comment

People who like this

0 Show 0 · 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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

8 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Distribute terrain in zones 3 Answers

Multiple Cars not working 1 Answer

PAD Xbox 360 0 Answers

Pad Controller xbox360 - triggers 0 Answers

The name 'Joystick' does not denote a valid type ('not found') 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