I have problem when I touch this to play audio , they wont play but if I input “transform.Translate(Vector3.back * speed * Time.deltaTime);” they work fine,
This tool I use
-GameObject with GUI Texture , Audio Source and This Script C#
this code i used to make it C#
public GameObject player;
void Start ()
{
}
public override void OnTouchBegan()
{
}
public override void OnTouchMoved()
{
player.GetComponent<AudioSource>().Play();
}
public override void OnTouchStayed()
{
player.GetComponent<AudioSource>().Play();
}
public override void OnTouchEndedAnywhere()
{
player.GetComponent<AudioSource>().Stop();
}
}
I use to Android Phone,