- Home /
Two joystick axis mapping to one Unity axis...help?
Hullo,
My game controller (DirectInput) has two joysticks, but I have a problem with the Horizontal axis on the left joystick mapping to two axis in Unity, one of which is the Vertical axis for the left joystick:
Physical Joystick Axis Maps to in Unity
Left Stick Horizontal Axis X, Axis 4
Left Stick Vertical Axis Y
Right Stick Horizontal Axis 3
Right Stick Vertical Axis 4
This means I can't seperate out the vertical movement of my right joystick (and movement that should happen on the movement of the right stick vertical is also happening on movement of the left stick horizontal).
Basically, I'm trying to build a twin stick shooter (moving spaceship with left stick, crosshair with right). The spaceship moves fine with the left stick, however, moving the ship forward and backward causes the crosshair to move up and down. Additionally, when using just the right stick to move the crosshair, the vertical axis never fully reaches 1 or -1 (I assume it's being influenced by the zero state of left stick horizontal).
Here is the Horizontal and Crosshair-Vertical Axis in the Input Manager:
The only other joystick axis in use are axis 2 (y) in Vertical and axis 3 in CrossHorizontal, I've purged the InputManager of all other joystick axis. The joystick works fine with Windows and other games.
Any advice on how to resolve this would be massively appreciated.