Trying to make my camera rotate using gamepad
Hello! Okay so I'm trying my hardest to make the camera rotate whenever I hold the right stick on my Xbox controller either left or right. I've managed to make it work with keyboard inputs, but for some reason my gamepad inputs aren't recognized?
I have a script that looks like this;
void Inputs()
{
inputRSHorizontal = Input.GetAxisRaw("DashHorizontal");
}
void Update()
{
if(Input.GetKey(KeyCode.Q) || (inputRSHorizontal < -0.1))
{
rotate = -1;
}
else if (Input.GetKey(KeyCode.E) || (inputRSHorizontal > 0.1))
{
rotate = 1;
} else
{
rotate = 0;
}
}
I have tried changing the numbers around, removing the input-GetKey functions from the if statements but nothing seems to work.
Here is my InputManager;
Any help would be very much appreciated!
Thanks in advance.
Your answer
Follow this Question
Related Questions
Cinemachine Freelook Camera Movement with Joystick 3 Answers
Quaternion.Euler to rotate camera with input system V2's snaps camera to 0 0 Answers
Right thumbstick (Rz) drift - camera moves on its own 3 Answers
Switch between touchscreen and Google VR to control the Unity camera 1 Answer
Camera Controller default position? 0 Answers