I want to keep playing windy audio when the player is running fast by pressing shift, but I can only hear the audio when I type in the keyboard, and I can’t hear the audio if I keep pressing it. How can I keep playing when I’m pressing shift? I chose Loop just in case, but it doesn’t work.
void Update()
{
// Left Shift -> Dash
if (Input.GetKey(KeyCode.LeftShift))
{
dashSound.Play();
StartCoroutine("Dash");
// DashLine Active
Transform dashPos = Camera.main.transform;
dashLine.SetActive(true);
Instantiate(dashLine, dashPos);
// DashDust Active
dashDust.SetActive(true);
}
else
{
dashLine.SetActive(false);
dashDust.SetActive(false);
}
}