Search Feedback

52
votes

Input: XInput Support

General

-

-

I'm doing some quick vertical prototyping for a game I have in mind using Unity, but a primary mechanic requires use of the analog left and right trigger buttons on the controller which are not properly supported on DirectInput. Support for XInput or proper Xbox 360 Controller support would be appreciated, perhaps using SlimDX.

Comments (5)

  1. 3f831df11f98ceaaeed8287e63691504?d=mm

    Jamie Fristrom

    Mar 31, 2012 06:22

    I'm having the same both triggers mapped to z-axis problem that others are reporting - I also wonder how many people don't realize that this is a Xinput vs directinput thing and don't realize that this is the place to report it to...

    The workaround from 2010 seems lame...and probably breaks mac & linux if you use it and don't also have axis equivalents, yeah?

  2. E0813b4765d57c95b97735bae391e71f?d=mm

    Aubrey

    Nov 10, 2010 17:11

    There IS a way around this. Someone has made an XInput based wrapper dll plugin:

    http://speps.fr/xinputdotnet

    It means that although you could use unity's standard input approach for everything, for triggers you need to make an exception. Rather nicely, it gives you access to everything else specific to XInput, including, I believe, rumble!

    But yes, it would be ideal to have this working in unity out of the box. Mapping both triggers to one axis was massively bone-headed move by MS, and everyone knows it.

  3. 0977254eb1282ee9a21806640b2cd195?d=mm

    BananaRaffle

    Sep 12, 2010 16:29

    @Aras: The problem is that the default Windows joystick API maps both the left and right triggers to a single Z axis (Joystick Axis 3), so it's impossible to differentiate between the left and right trigger pull. For example, pulling both triggers only sets Joystick Axis 3 to the value 0.0. What we want is a separate axis for each trigger, and XInput supports that.

  4. Bb15a3f6914a9a2c3229192488ad2dd7?d=mm

    matthew flashbang

    Jan 19, 2010 21:03

    Triggers are not supported well because they map to the same axis in Unity. 0.0 is no triggers pressed, -1.0 is left trigger pressed, 1.0 is right trigger pressed.

    This means both triggers pressed = 0.0. This is bad if you're doing a racing game and want to have independent braking (ie tapping brake while racing will do something different from just letting go of the right trigger).

  5. F7c2a28b987d5be050e371270bdc785f?d=mm

    Aras Pranckevicius

    Nov 30, 2009 07:50

    Just wondering: how exactly the triggers are "not supported"? I did play around with 360 controller a while ago, and all buttons/triggers did seem to work.

Your opinion counts

Help us make things better. Share your great idea for improving Unity or vote for other people’s.

Log in to post a new idea

Categories

All

(9031)

2D

(221)

Ads

(40)

AI & Navigation

(67)

Analytics

(92)

Animation

(304)

Asset Store

(222)

Assets

(489)

Audio

(157)

Cloud Build

(94)

Collaborate

(31)

Docs & Tutorials

(197)

Editor

(2084)

Everyplay

(13)

Game Performance Reporting

(12)

General

(810)

Graphics

(761)

GUI

(363)

Input

(145)

Licensing

(73)

Networking

(158)

Physics

(341)

Platforms

(402)

Profiling & Optimization

(69)

Runtime

(161)

Scripting

(1014)

Terrain

(152)

WebGL

(131)