axis work correctly but buttons doesn't in Android Build
I'm Building a VR mobile game and I control this Game by PS3 controller and Xbox controller, The Controller work very well in Unity editor with all buttons and axis. And when I connect the controller with android phone all the button works and axis too. The Problem that's when I build the Game in Android only axis work buttons doesn't. Although I change the Input Manager settings many times it's also did nothing. And did several things like:
This line of code get the axis value:
float steering = CrossPlatformInputManager.GetAxis("Horizontal");
So I tried to get value from button and make virtual button named "joystickButton2" like this:
bool speed = CrossPlatformInputManager.GetButton("joystickButton2");
it doesn't work too.
I replace the CrossPlatformInputManager
class with regular Input
class and it similar to the CrossPlatformInputManager
class.
bool speed = Input.GetButton("joystickButton2");
I tried to get the key it-self by GetKey function like:
bool speed = Input.GetKey (KeyCode.joystickbutton2);
Nothing happened too. I tried many things and several things but still only axis work and buttons didn't.
Your answer
Follow this Question
Related Questions
Input.GetAxis() wrong values on laptops 0 Answers
Input.GetAxisRaw with New Input System? 0 Answers
XInput D-Pad and Triggers not working 0 Answers
Best way to handle inputs? 0 Answers