|
How do I get started with controllers? I want to map controls to a 360/PC controller but I don't know where to begin? I'm having no problems with mapping controls to keyboard and mouse, but I don't know how to have Unity recognize my controller to begin with. Any help would be great, thanks in advance.
(comments are locked)
|
|
Unity should recognise it so long as windows does (not sure how well 360 controllers work with Macs). If you plug in your 360 controller (wired works best) and get windows to see it fine under Game Controllers, you should have no problems using it in a Unity Game. Make sure you use Input.GetAxis and Input.GetButton rather than Keys, and check your Project>Input Settings for default button assignments to the joystick. Edit: Two additional points: although the 360 controller works as-is on Vista and later, you will need to get a driver for XP to see it, much like the PS3 SixAxis does. The other thing is, I would not recommend getting direct joystick keycodes in Unity; far better to use GetButtonDown("Fire1"), as that will be called if the user pressed left mouse button, left CTRL or Fire 1 on the joystick (by default). The user can also re-map the keys when using GetButton and GetAxis. Have a look at the 3D Platformer tutorial, you should find that works with controllers straight away. Interestingly, though, I found I had to invert the Y axis when using a controller or else the stick forward-back motion was the wrong way around. @Alexander when using names like "Fire1" instead of keycodes, is it possible to create custom names like "Magic1"?
May 04 '12 at 11:53 PM
numberkruncher
yea you can name it anyway you want in the inputmanager.
Jul 19 '12 at 04:01 PM
Mander
(comments are locked)
|
|
If you are using a Mac, or want to package a driver for mac, here is an open source driver. Also of note, check out Post on buttons mappings for a 360 controller
(comments are locked)
|
|
I tried it with a PS3 controller once. I had to:
(comments are locked)
|
|
This should help... http://unifycommunity.com/wiki/index.php?title=Xbox360Controller
(comments are locked)
|
|
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
(comments are locked)
|
1 2 next page »

You should note that if you install the controller while Unity is running, it will not work until you restart the program. (Using model 1403;1086 and Unity 4.0.0f7).