if (Input.GetKeyDown(KeyCode.LeftAlt))
{
m_WalkSpeed = 2f;
m_AudioSource.clip = m_LandSound;
m_AudioSource.Stop();
}
if (Input.GetKeyUp(KeyCode.LeftAlt))
{
m_WalkSpeed = 5f;
m_AudioSource.clip = m_LandSound;
m_AudioSource.Play();
}
I want to stop Land Sound while Left Alt button pressing. But it won’t work. I am using Standart Assets of FPS Controller by Unity3D. How should I do that?