UI Button to move character

Can I use UI buttons to move my character? I’ve always used WASD or the arrows to steer my character, but now I want to get my app into my device so I have to use the UI buttons. Is this possible?

This is my script I’m using with WASD and the arrows. I want to convert this script to UI buttons instead of WASD and arrows.

var speed : float = 6.0;
var jumpSpeed : float = 8.0;
var gravity : float = 20.0;
var turnRate : float = 2;

private var moveDirection : Vector3 = Vector3.zero;

function Update() {
	var controller : CharacterController = GetComponent(CharacterController);
	var turnForce = Input.GetAxis("Horizontal") * turnRate;
	if (controller.isGrounded) {
		// We are grounded, so recalculate
		// move direction directly from axes
		moveDirection = Vector3 (0, 0, Input.GetAxis("Vertical"));
		moveDirection = transform.TransformDirection(moveDirection);
		moveDirection *= speed;
		
		if (Input.GetButton ("Jump")) {
			moveDirection.y = jumpSpeed;
		}
	}

	// Apply gravity
	moveDirection.y -= gravity * Time.deltaTime;
	transform.Rotate(0,turnForce,0);
	
	// Move the controller
	controller.Move(moveDirection * Time.deltaTime);
}

You can import a joystick from the asset store to make your job easier or use buttons for arrow keys (4 buttons, 5th one if you wanna jump) then make a float instead of Input.GetAxis and change that float how you require when button press (each button has a button component, drag the player object over there, then it will ask for a function, choose the script name → choose the float → give the value)