Nimbus and MFi controller mapping on iOS

By March 7, 2019Uncategorized

To support controllers in your iOS app, built with Unity, there’s not much you need to do. You simply connect the controller and read either floats or bools.

MFi and why it is good
Only MFi (made for iOS) controllers will work with an iOS device. For a controller to be certified as MFi, there are some rules and as a result they all seem to have the same button layout (afaik). So this makes things pretty easy for us game developers!

This doesn’t work on MacOS or in the editor
And I don’t know why.

So what to do?
You don’t need to make changes in the Input Manager.
You connect the controller via bluetooth settings to your iOS device
In your Unity app, you can now begin to read out the values. You can either read axis values, which works for all “analogue” sticks and pressure sensitive buttons, or you can read booleans for the buttons.

To read out Axis number 1
Input.GetAxis(“Axis 1”); //Each button has it’s own axis to read out pressure sensitivity. This returns a number between 0 and 1. However for the analogue sticks the setup is slightly different, you get a number ranging from -1 to 1, with 0 as the “deadzone”.

To read out Button number 1
Input.GetKey(KeyCode.JoystickButton1); //returns true if pressed

Here’s an easy to share picture: