I want to convert this on an android by creating a button. This is a flashlight code toggle on and off on FPS. Im working on a thesis proj which is mobile and Im a beginner in Unity. The code works fine. Thanks for response.

using UnityEngine;
using System.Collections;

public class FlashlightToggle : MonoBehaviour {

public Light flashlight;
private bool isOn;
public AudioClip flashlightOn;
public AudioClip flashlightOff;
public AudioSource source;
void Start()
{
    isOn = true;
}
void Update () {
	if (Input.GetKeyDown (KeyCode.F)) 
	{
		if (isOn == false) {
			flashlight.enabled = true;
			isOn = true;

			source.PlayOneShot(flashlightOn);
		} else if (isOn == true) 
		{
			flashlight.enabled = false;
			isOn = false;
			source.PlayOneShot(flashlightOff);
		}
	}

}

}

Hello there.

OK, first you need to work around touch not keys, for debug it’s OK, but, for the android you need to read about touch input, check the documentation, even has a very basic example of it, cheers.