i've got a 360 controller now have been testing the buttons - i can get all but 2 to work - the larger (lower) triggers or shoulder buttons. what i've figured out so far: joystick buttons: 00 = 01 = 02 = 03 = 04 = 05 = hat up 06 = hat down 07 = hat left 08 = hat right 09 = start 10 = back 11 = left analog click 12 = right analog click 13 = shoulder top left 14 = shoulder top right 15 = xbox 16 = a 17 = b 18 = x 19 = y i also don't understand why i have five open slots at the beginning but only two missing buttons - none of these slots get any response from the triggers (or anything). for reference i have the axes for the analogs set up as follows (this works fine): move horizontal = X axis move vertical = Y axis look horizontal = 3rd axis look vertical = 4th axis anybody have any experience with this?
But aren't those analog like the thumb-sticks? If so then they might not be treated as "buttons" and not appear in this list. As to why there are open slots, maybe they initially imagined an even larger set of buttons early on (and collapsing to use the lower spaces might have broken content already in the works)? I just don't know what those empties would be as I don't have any direct experience here, sorry... Hope that helps, or at least makes this a less lonely thread.
hmm, that does make sense but i just ran through them all (joystick axes) nothing seems to work. evrything else works great - just can't get these two(important) triggers going... ; )
I just sent you a reply to our PMs on this issue. The weird thing is I can get the triggers to work on the 5th and 6th axes, but my mappings for the buttons are slightly different than the ones you listed. Could this be a driver issue. I'm still on version 0.02 of Colin Munro's 360 driver since I really haven't experimented with with the 360 controller inside Unity in a while (I use it all the time for emulators though and it works great). Let us know if you get the triggers working (and on what axes)... I had no problem mapping them to 5 and 6. Maybe I'll go through all the buttons and axes right now and post a list to see just how different our configurations actually are. Ethan [Edit- Quick and dirty rundown of my 360 buttons] Button 0 - nothing Button 1 - nothing Button 2 - DPad Up Button 3 - DPad Down Button 4 - DPad Left Button 5 - DPad Right Button 6 - Start Button 7 - Back Button 8 - Left Analog Stick Press Button 9 - Right Analog Stick Press Button 10 - Left Shoulder Button Button 11 - Right Shoulder Button Button 12 - XBox Button Button 13 - A Button 14 - B Button 15 - X Button 16 - Y Button 17 - nothing Button 18 - nothing Button 19 - nothing Analog Stick Axes Same as drJones 5th Axis - Left Trigger 6th Axis - Right Trigger
hmm - no luck here (i just retried all the axes with the gravity-dead-sesitivity settings you sent). i think you're right it might be a driver issue as i'm using the latest .05 - i'll play with it some more though. thanks antenna ; )
Well after playing around with the 360 controller again today in an FPS setting with Unity I must say that it would be great to standardize the inputs of this controller so we could safely make it a solid option for Unity games. Does OTEE have any more input into how the 360 controller coud work as a standard controller without any of these problems?
A solid and consistent set of drivers? Documentation as to what folks should expect out of the controller? Sorry but I'll admit once again that I'm not very experienced with using the 360 controller on a Mac/PC but from the "outside" it seems as if it's not well put together just yet... Please feel free to direct me to any links for info that you have as I'd definitely like to read up on this a bit more (doing some searching on my own as well but anything you have handy would help speed my efforts ).
you've probably seen this already but here's the site where the driver is located hig: http://tattiebogle.net/index.php/ProjectRoot/Xbox360Controller/OsxDriver i was thinking of just sending a message to him but the thing is it works fine in the driver control panel (the triggers register in the built in tester) - so it would seem to me its unity that is having the issue. i'll continue testing it when i get the time. you're right though - the driver is still young at this point (the mapping has changed at least once already) so its hard to say.
Yep, I've seen that link, thanks for making sure though. The problem here is that it will be very hard for us to do much of anything when this is 3rd party unofficial driver sets that are changing (often?). Don't get me wrong, I like the direction you're going with this and it's worthy of discussion, but it's just that I'm a bit hesitant when it comes to spending any of our time/energy as we have so much other work to do. If/when we have some spare bandwidth I hope we can take a look at this a bit closer, until then I fear you're entering the land of the unknown without us. Be brave!
Not sure I'll be much help, but I've done some XNA programming and the difference between the axis of the thumbsticks as opposed to the triggers is that the thumbsticks go from -1 to 1. the triggers just go from 0 to 1. Again, not sure if it helps...just offering some info...
Hi, I realize there's a bunch out there on this topic, but I'm still having trouble getting any axis controls to work. Buttons work fine, but the axis doesn't seem to see it. Code (csharp): var cubeSpeed : int; function Update () { var x = Input.GetAxis("Horizontal") * Time.deltaTime * cubeSpeed; var z = Input.GetAxis("Vertical")*Time.deltaTime * cubeSpeed; transform.Translate(x, 0 , z); And in the input manager I've set the Horizontal to: Type joystick Axis Axis 7th axis(joysticks) Any help would be appreciated. Thank you.
@ProfCWalker: 1. Welcome to the forums! 2. When posting code, use the "Code" button, or manually wrap your code in code tags ([ code ]...[ /code ], without the spaces) for better formatting (I've edited your post as an example). 3. I'm not sure your question really warrants tacking on to the end of someone else's thread. You'll likely do better by posting in your own thread and starting something anew. Your code in general looks ok, does it work when using the arrow keys and/or WASD? How are you verifying that things are "working" versus not? What do you set cubeSpeed to in the inspector? I see that you're not properly closing your Update function with a trailing }, is that a copy/paste error or is this all due to that and you're not noticing the script/compile error?
Wait.. so Unity can make Xbox360 games for the 360? Just wondering (I know it's not completly related to the subject but I had to ask).
No, Unity cannot yet support the creation of XBox titles (neither retail nor XBLA). This is a discussion about using controllers with desktop computers, and one controller folks like to use is a XBox 360 controller by installing the required drivers.
Thank you for the quick reply. 1. Yep, it was just a code snippet I pasted in. 2. Thank you for the Code cleanup on the previous post. 3. WASD works with it. My initial 'checking' for the 360 controller was testing it at: http://www.rotorheadgame.com/unity/joytest.html. Everything worked in terms of response. My cubeSpeed was just a var multiplied by Time.deltaTime and assigned to objects transform, which works with the keys. If you think starting a new thread would work better, I would be happy to do it. Thank you!
No. This has been asked a number of times here on the forums so search around for prior threads. We haven't announced anything so there's just no information to share at this time. Let's get back on topic please. Odd, perhaps you can check with whoever made that demo? Sorry but I'm just not adept at X360 controller issues and was hoping to catch some low hanging fruit here (like cubeSpeed of zero or a script error). For now we'll roll with it here. Anyone out there with first-hand X360 controller experience, please chime in!
Just wanted to let you know I got it working. I'll post a complete packet and write up on this shortly for those that need assistance. Thanks
Hi All, just came across this thread while trying to figure out getting the 360 controller to work with unity. ProfCWalker, your last post "Just wanted to let you know I got it working. I'll post a complete packet and write up on this shortly for those that need assistance." I'm wondering if you managed to complete the packet? and or if you would be willing to share your solution. Thanks
I came also at this post by 'googlin' but it seems there isn't an answer for a correct 360 controller configuration. :roll: plz notice me if there is any...
Hi, Here's a simplified working example for you. Let me know if you have any issues with it. Thank you, Walker
Thanks for the source code I've not had time to evaluate yet but really appreciate the help I will let you know how I get on with it.
Thanks so much Mr Walker for that example scene file. It will do wonders for my trouble shooting, I'm sure. Unfortunately, nothing happens for me in that scene. I'm running Win7 32bit, using a wired xbox360 controller that works fine in Magicka, LiveForSpeed, and LevelR. I haven't messed with any drivers, just plugNplay as far as I can tell. I have restarted the machine with the controller plugged in. I am focusing the game window on playback. I can't think of anything else I could be doing wrong. I see your player cube in his little corral and the script is activated, but nothing responds to any controller input. Is there something else I'm supposed to do to configure that scene file? Thanks again
Since this post is 4 years old, the project was probably built during the Unity 1.x days. Although the Input Manager hasn't changed much since then, I wouldn't expect a project built that long ago to work with 3.x. You might want to start from scratch. I don't have an x360 controller otherwise I could give it a test for you. All my joysticks are Logitech's which so far have worked well (as long as only one is plugged in).
Speaking of the Dpad, i am working with the Antares Universe and I need to get the Dpad and triggers working... but there seems to be no way to get them working (using the drivers from Microsoft)... and i used Professor walkers packet and it works , but now for my own project, nothing is happening
In case anyone finds this useful, these are the inputs for an XBOX 360 USB controller on Mac OS X 10.7 Lion, in Unity 3.4.2 00 = ? 01 = A 02 = B 03 = X 04 = Y 05 = LB 06 = RB 07 = Left Stick Button 08 = Right Stick Button 09 = Start 10 = Back 11 = Xbox 12 = D-Pad Up 13 = D-Pad Down 14 = D-Pad Left 15 = D-Pad Right 16 = A 17 = B 18 = X 19 = Y Analog Sticks + Triggers: X/Y-Axis Controller = Left Stick X/Y-Rotation Controller = Right Stick Z-Axis Controller = LT Z-Rotation Controller = RT If anyone has any idea what button 00 is, please post it.
Let's resurrect this ancient thread one more time! I just bought an Xbox 360 controller and tried running it with version 0.11 of the Tattiebogle driver, OSX 10.6.8 and Unity 3.5. I got this mapping: Code (csharp): X Axis Left stick X Y Axis Left stick Y 3rd Axis Right stick X 4th Axis Right stick Y 5th Axis Left trigger 6th Axis Right trigger Button 0 Unknown Button 1 Unknown Button 2 Unknown Button 3 Unknown Button 4 Unknown Button 5 Dpad up Button 6 Dpad down Button 7 Dpad left Button 8 Dpad right Button 9 Start Button 10 Back Button 11 Press left stick Button 12 Press right stick Button 13 Right shoulder Button 14 Left shoulder Button 15 Xbox button Button 16 A Button 17 B Button 18 X Button 19 Y ...which is completely different to any of the mappings listed above! Not sure what to make of that. It seems to me that there's no way you can rely on a particular mapping working for any given user of your game. It also points to the need for a better way of handling and configuring input in Unity....
I was having to map a controller for work and was getting annoyed with things not being up to date for 3.5 so i wrote this. It's a test application to help map the controller. The actual only change i noticed from Unity 3.4.2 was the 4th and 5th axis seem to be swapped. If there are any issues just let me know. You should just have to unzip the assets and project settings folder into a blank project. Enjoy! View attachment $Input Test Improved.zip
NCarter - I totally agree the Input system in Unity is in desperate need of a rethink. KyleHatch - I tried out the test file. It doesn't match the layout of my xbox360 controller (I don't think it was meant to) but it proves NCarter's point. [Warning - rant ahead...] At the moment the only way (that I know) of detecting what devices are connected is Input.GetJoyStickNames() which just returns an empty string in some cases. (I've file a bug report). This means I can't even rely on the hacks I've come up with to fix weird issues such as the triggers registering different values before they are first pressed. There needs to be a reliable method of detecting both the device and the driver being used. Then at least you can create profiles for the different combinations and be able to tell your customers what setups are supported. Or Unity themselves need to provide a list of devices and drivers they support and what the expected output from the device should be. Input is so important in games and nothing makes me put one down faster that when it's poorly implemented. I've mentioned this before but there needs to be a OOP way of accessing inputs that doesn't rely on strings. That would also help to abstract input from game logic making cross platform development easier. There's a couple of Input managers on the asset store but all fall short for me because of this limitation. My gold standard for input is Portal2. You can seamlessly switch between devices and it just works. It also changes the gui icons to match the device you are using. This is what I aspire to in my own games but the input implementation in Unity is making it very hard work. If anyone has any suggestions in case i'm approaching any of this wrong or how I might get lower level access to input devices that for both Mac and PC I would be much appreciated. I'd rather support a few devices very well than a whole bunch in a hodge-podge manner. [..and relax]
Just coming into this conversation, but (for us visual folk) hopefully this will help. This is using Tattie Bogle.
Setting up with the two joysticks on the xbox controller, one for forward/backward and sides, the right joystick for looking around: http://www.youtube.com/watch?v=Z591NmskYcY&feature=youtu.be
After 2 years of suffering with these and other oversights and after giving up all hope that anyone was even paying attention to this long lost corner of code, it looks like there might be a light at the end of the tunnel. Unity 4.x (not initial release, but "an early version") is supposed to FINALLY make some improvements to the Input system. See CreativeChris's post here. The only reason I paid for the Unity 4 preorder upgrade was the faint hope that they might someday remember about Input. It looks like that gamble may have been worth it after all. (Keeping fingers crossed.)
I made a little package that contains an InputManager.asset with all the axis set up and a wrapper that makes accessing them simple and intuitive. Hopefully it will save some time and headaches. You can download it here. Example: Code (csharp): Gamepad.GetButtonDown(Gamepad.Button.A, Gamepad.Index.One); Gamepad.GetAxis(Gamepad.Axis.LeftStick, Gamepad.Index.Two); Gamepad.GetTrigger(Gamepad.Trigger.Left, Gamepad.Index.One); Gamepad.GetState(Gamepad.Index.Four);
According to the ETC Internal Unity3d Wiki: http://wiki.etc.cmu.edu/unity3d/index.php/Joystick/Controller Spoiler Microsoft Xbox 360 Controller Buttons (Key or Mouse Button) joystick button 0 = A joystick button 1 = B joystick button 2 = X joystick button 3 = Y joystick button 4 = L joystick button 5 = R joystick button 6 = Back joystick button 7 = Home joystick button 8 = Left analog press joystick button 9 = Right analog press Axis (Joystick Axis) X axis = Left analog X Y axis = Left analog Y 3rd axis = LT/RT 4th axis = Right analog X 5th axis = Right analog Y 6th axis = Dpad X 7th axis = Dpad Y
I'm using an Xbox One controller. Here are my buttons: 0 = A 1 = B 2 = Y 3 = X 4 = LB 5 = RB 6 = SELECT 7 = START 8 = LEFT STICK PRESS 9 = RIGHT STICK PRESS 10 to 16 do nothing, at least not yet. But I want to move the camera with the right stick. Any inputs for that?
Hey @JacksonTheXtremeGamer, have you had a chance to try the solution here? https://answers.unity.com/questions/146546/rotation-with-right-stick.html Looks like it may help!