Android movement

Hello, I’m really new to unity :smile: I want to try making a game for android though. I have this script but I don’t know how to make a script with the same function but only if you press in-game buttons. I hope some of you can help me :smile:.

var rotationSpeed = 100;
var jumpHeight = 8;

private var isFalling = false;


function Update () 
{
	//Handle player rotation.
	var rotation : float = Input.GetAxis ("Horizontal") * rotationSpeed;
	rotation *= Time.deltaTime;
	rigidbody.AddRelativeTorque (Vector3.back * rotation);
	
	if (Input.GetKeyDown(KeyCode.W)  isFalling == false)

	{
		rigidbody.velocity.y = jumpHeight;
	}
	isFalling = true;
}

function OnCollisionStay ()
{
	isFalling = false;
			
}

Hey there, welcome to Unity!

You’ll want to check out this page: Unity - Manual: Immediate Mode GUI (IMGUI)