- Home /
Android Action Button
I can't tell when the user hits the main button on their phone the button that i guess i would call the trackball down
I tried this code but it won't work. And i am testing on my droid each build and its annoying because ive tried so many ways to get the input of the user hittign the main button down
I put the code in the Update() loop, the mousedown works on PC but not for android, and Input.inputString is always empty too :(
if (Input.anyKeyDown)
{
var randomness = Random.Range(0,3);
if (randomness % 2)
debug_out = "u did it";
else
debug_out = "u did it again!";
}
Answer by WitchTheWicked2 · Jan 13, 2012 at 02:46 AM
if ( Input.GetKeyDown(KeyCode.JoystickButton0) ) { //do task }
I answered my own question, and this is for future reference for people who get stuck like me.
your welcome.
Your answer
Follow this Question
Related Questions
Android Input 1 Answer
How to allow clicking of 2 buttons at once in Android 0 Answers
Android to unity INPUT 0 Answers
SendMouseEvents.DoSendMouseEvents() allocates garbage every frame 1 Answer
A node in a childnode? 1 Answer