Adding Controller Support to Unity3D

In porting over my latest creation Primitive – Combat Simulator to the NVIDIA Shield TV I tinkered around with including controller support. This is not meant to be a full blown tutorial, but somewhat of a starting guide to point you in the right direction. You will still have to experiment to find what works best for you.

 

controller

========================================

 

thumbstickleleftx – Controls the Left analog Y axis which is up, and down. In my case this controls the forward, and backwards movement in 3D space. Dead(zone)is how much the analog has to move before the input is registered – the lower;the more responsive. Sensitivity is set to one as default.

Type is set to Joystick Axis for the controller. Axis is set to Y axis to control the up, and down movement of the left analog. If you want to control the left, and right movement we would set this to X axis. However this only applies to the left analog. If we wanted to control the right analog’s axis we would have to set the appropriate axis for the platform. In Windows axis 4 /5  respectively would control X/Y on the right analog.

========================================

rightbumper – Self explanatory – the right bumper of the controller.

Gravity is set to 0, Dead is set to 0.2, and Sensitivity is set to 1000. 

Positive Button is set to joystick button 5 which corresponds to the Windows platform for registering the button press. Under Linux, and Mac OS this will be different. Axis can be left where it is, and Type should be set to Key or Mouse Button.

========================================

Please note the settings above correspond to the Shield TV Controller, and not the Xbox 360 Controller. You may have to change a few things around, but it is straight forward, and simple.

For additional information see the links below:

Xbox 360 controller – http://wiki.unity3d.com/index.php?title=Xbox360Controller

NVIDIA Shield TV Controllerhttp://docs.nvidia.com/gameworks/index.html#technologies/mobile/game_controller_spec.htm

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s