Input manager android help

As the title states I need some help. More than anything what i need is a good overall explanation on how to use for android. I have a pause script that once"p" is pressed that game is paused. How would i translate to android. In the input manager ive made my own Axes which is called Pause. In my script im trying to access the Axes by using the Input.GetButtonDown the game still pauses by pressing “p” but not by me touching the particular object that the script is attached to.

I hope im making this clear.

Any advice would be appreciated. Heres my code please point out any errors.

Thank You

var paused : boolean = false;

function Update ()
{
if(Input.GetButtonDown(“p”) paused == false)
{
paused = true;
Time.timeScale = 0;

}
else if (Input.GetButtonDown(“p”) paused == true)
{
paused = false;
Time.timeScale = 1;

}
}

var paused : boolean = false;

function Update ()
{
if(Input.GetButtonDown(“p”) paused == false)
{
paused = true;
Time.timeScale = 0;

}
else if (Input.GetButtonDown(“p”) paused == true)
{
paused = false;
Time.timeScale = 1;

}
}

1480249--81933--$Untitled-3.jpg

By the way, here’s a cleaner way to do that code: (so it doesn’t double check that the key is down, just a small code thing that may help down the line)

        if (Input.GetButtonDown("Pause")){
            if(!pauseCheck){
                pauseCheck = true;            // Game is now paused
                Time.timeScale = 0;            // Officially pause the game
            }
            else{
                pauseCheck = false;            // Game is now unpaused
                Time.timeScale = 1;            // Officially unpause the game
            }
        }

I’m actually doing this right now, except I’ll deal with Android controls later once my game is done (it’s a simple game, so the change in controls won’t matter too much).

Now, on the current question… I have yet to actually do this, but here is something I plan to follow soon enough to solve this specific issue:

I’m not exactly sure he goes over all the basics again, but it seems like he does so you may not have to watch the original Parts 1 and 2.

Edit: Seems like you have to watch parts 1 and 2 to actually know how to do this. The video above is just on how to improve on the original script.
Part 1: https://www.youtube.com/watch?v=uUIXFL2ic7k

Thanks for helping clean up my code. And yes Ive seen Devin’s tutorials and they don’t make sense to me at all. Its just too much information thrown at me.

I just realized… the Android forum actually may help you faster (or at all, if none of the current lurkers do Android programming). If you don’t get any replies any time soon, feel free to open a thread over there.

I’m assuming you already looked at this?
http://docs.unity3d.com/Documentation/Manual/Input.html#AndroidInput

Sorry for not being able to completely answer your question. Good luck!