I am working on a tank game but whenever i use this code and move around a lot it starts bugging out and plays weird parts of the audio. can someone ether give me a reference or add on to my script. Thank you for all your help unity answers.
function Update()
{
if(Input.GetButtonDown("Vertical"))
{
audio.Play ();
}
if (Input.GetButtonUp("Vertical"))
{
audio.Pause();
}
}
and another script for moving up and down
function Update()
{
if(Input.GetButtonDown("Horizontal"))
{
audio.Play ();
}
if (Input.GetButtonUp("Horizontal"))
{
audio.Pause();
}
}
it a js.
– tssI don't have an answer for you, but just to be clear about the question: these are two separate audio sources on two separate game objects?
– robertbu