So, I’m making a game about a ball that every time that it does a dash, a sound is played. This soud repeats a lot of times and if it starts to play again while it’s still playing the sound stops and restart. is there anyway I can make the sound don’t stop play to play again? Sorry for my bad english, I’m Brazillian.
Here is the code I’m using to play the audio:
public AudioSource dash;
private void Update()
{
if (Input.GetKey(KeyCode.LeftShift))
{
if (Input.GetKeyDown(KeyCode.Space))
{
Dash();
}
}
}
void Dash()
{
dash.Play();
}