Joystick 3rd Axis problem on Linux
Hello there,
I've implemented the Joystick inputs. It works perfectly using the 360 controller on Windows.
The problem is that the Right Trigger, which I have referenced from the Input Properties as 3rd Axis ("Joystick and Scrollwheel"), works fine on Windows but it doesn't on Linux. On Linux it works like I was holding the Directional Pad as Inverted (6th Axis): the character moves to the right, instead of crouching.
Any any idea on this?
Thank you
You could let the user choose which axis to use in the Input Settings when launching the game.
If you don't want that dialog to popup, you can write your own rebind system in-game and change your Input code to use a wrapper class which figures out which axis to use.
Input.GetAxis("Horizontal");
// Changes to...
InputWrapper.GetAxis("Horizontal");
And your InputWrapper class looks something like this...
public static class InputWrapper
{
// You can rebind input like...
// InputWrapper.$$anonymous$$apping["Horizontal"] = "Joy0X"; // According to Input.GetJoystickNames
public static Dictionary<string, string> $$anonymous$$apping = new Dictionary<string, string>();
public static float GetAxis(string axis)
{
if ($$anonymous$$apping.Contains$$anonymous$$ey(axis))
return Input.GetAxis($$anonymous$$apping[axis]);
else
return Input.GetAxis(axis);
}
}
... Or find an existing solution online. I don't know of a supported way to directly remap the controls and primary/secondary fields as in the Input Dialog so in my experience you always have to go through another layer - IF you don't set it up in the settings dialog that appear when the game run.
See also Input.IsJoystickPreconfigured, Input.GetJoystickNames, Conventional Game Input
Hi there,
Thanks a lot for all the information! But that's not actually the problem.
The assignation is correct. In fact it'ss the same for the sprint action, but inverted (negative). And this last one works fine.
We use the configuration menu inside the game, using our own system.
So the problem is that it's reading another key/axis. I don't know why.