Problem:
Just as the title says. It’s the same for both Horizontal and Vertical axes. Input.GetAxis() works just fine.
Interestingly, when I click Mobile Input → Disable then CrossPlatformInputManager.GetAxis() starts working with the WASD keys.
The specific control I’m using is the DualTouchControls prefab. I removed the turn/look controller but kept the MoveTouchPad.
What I’ve done to try and fix it:
- Deleting everything referencing the CrossPlatform (including objects in scenes of course) and reimporting
- Verified that there is an EventSystem in the scene
- Checked to make sure the MobileControlRig is set to target the correct axes in the inspector
- Set you Unity build settings to a mobile build (specifically Android)
- I’ve also built the project and put it on my phone (Galaxy S6) with no luck
Most people with this problem that I have seen from Googling were missing EventSystems but I had always had one and I cannot for the life of me figure this out.
I have not modified any code in the CrossPlatformInputManager and the only code I have calling it is assigning the vertical and horizontal axes to variables:
float turn = CrossPlatformInputManager.GetAxis("Horizontal");
float acceleration = CrossPlatformInputManager.GetAxis("Vertical");