Setting your own inputs is easy and setting up for the XBOX controller is no different. Here we will look at how to set up your Input Settings in Unity.
Got to Edit > Project Settings > Input to open the Input manager window.
We will look at setting up standard controls for both Windows and Mac for the FirstPersonController Prefab. This means we will look at Jump, Horizontal, Vertical, MouseX and MouseY. First we will set up the Jump Input. Open the Axes menu in the Input Manager Widow and then open up the Jump Input. You will notice that the Positivie Button is currently set to (space), and the Alt Positive Button is blank. In this example we will set up the Alt buttons for Mac and the other for Windows.
We will set up the A button to jump. Type joystick button 0 in the Positive Button slot and joystick button 16 (for mac) in the Alt Positive Button slot.
All other buttons are set up in the same way. Leaving Type as Key or Mouse Button, and for a single player leave Joy Num as it is.
Setting up the joysticks is also easy but we need to look at few other settings. In this example we will look at changing the Horizontal and Vertical axis inputs. Open up the Horizontal Axis Input in the Input Manager window. Change the type to joystick axis and select the correct axis (in this case X Axis) we also need to amend the dead setting. This calculates when to stop moving, as the joysticks may not exactly return to 0 after movement we need to set a higher number for killing movement, in this case we have set it at 0.25.
The Y Axis is very similar but we need to invert the input as well otherwise when you press forward you will move backwards.
All other inputs are set up in a similar way.