I recently bought a Game Pad “8bitdo sn30 pro+”
I wrote a prototype to see how I could get it working my my games.
I’m not sure but I think it behaves like a 360 controller, also I’m not sure if the Axisis are different if you’re using it on a different OS, All the games I write are Android-based so I changed the project type accordingly
The Game Pad left stick works and 2 of the 4 buttons are working fine “out of the box” although Fire3 for joystick button 2 does not do anything in the input manager.
Anyways so I thought I would go into the input manager “I’m using the old version not the package manager version” and create additional content.
I’m using some source “visual” from the following link http://wiki.unity3d.com/index.php?title=Xbox360Controller
As this controller has names on the trigger buttons I thought I would match that:
“Left Trigger 2”
Name = L2
Gravity = 1000
Dead = 0.2
Sensitivity = 1000
Snap = Checked
Invert = Checked
Type = Joystick Axis
Axis = 3rd Axis (Joystick and Scrollwheel)
Joy Num = Get Motion From all Joysticks
Here is the code I call:
float mL2 = Input.GetAxisRaw("L2");
//Debug.Log("Left Trigger Pressed: " + mL2);
if (mL2 > 0)
{
Debug.Log("Left Trigger Pressed: " + mL2);
}
Input.ResetInputAxes();
Although the code does run it has problems but I’m not sure if it is the input setup or something else.
A - It fires on all triggers
B - The ResetInputAxes does not work, once a button is pressed the code keeps getting called.
So far I’m at a loss with this one.