- Home /
The right answer was discovered and the question is no longer in need of answering
Code always returns zero
This bit of code always returns zero:
float aX = CrossPlatformInputManager.GetAxis("Horizontal");
float aY = CrossPlatformInputManager.GetAxis("Vertical");
Debug.Log(aX);
Debug.Log(aY)
Does anyone know why this is happening? I am using Unity remote on my iPhone, therefore, shouldn't CrossPlatformInputManager.GetAxis("Horizontal");
return something?
Answer by Kimimaru · Dec 09, 2018 at 12:14 AM
You need to provide more details (and please change the topic title to be relevant). Is this working in editor and not on the device? How are you controlling your character (Ex. virtual buttons)? Are "Horizontal" and "Vertical" defined anywhere in CrossPlatformInputManager
?
The code does work in the editor, but, not on the device. Here is a screenshot of my input manager:
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Getting the text from UIInput 1 Answer
Projection to mouse position in isometric game 1 Answer
How to make shortcuts using two keys 1 Answer