Question by
EhanGoosch · Feb 20, 2019 at 12:29 AM ·
controller
Switch Pro controller incorrect axis
I'm using my pro controller to play my game, but the movement doesn't work. Pushing up or down on the left joystick affect none of the axises. Pushing Left or right on the joystick affects the Vertical Axis.
This is the code I'm using:
float XInput;
float YInput;
void Update()
{
XInput = Input.GetAxisRaw("Horizontal");
YInput = Input.GetAxisRaw("Vertical");
if(XInput != 0||YInput != 0)
{
Debug.Log(XInput);
Debug.Log(YInput);
}
}
Comment
Answer by AndreasScholl · Apr 13, 2019 at 10:21 AM
I had the same problem.
To make it work the switch pro controller axis have to be mapped in the following way in Project Settings/Input:
Horizontal:
Type: Joystick Axis
Axis: Y Axis
Vertical:
Type: Joystick Axis
Axis: 4th axis (Joysticks)
Edit: formatting