Does anyone have any idea why my sound would work perfectly on level 1 but not level 2?
I tested first level, and correct audio will play on free fall and if I was holding space. But on level 2 the collision and success audio will only play when holding spacebar… I’m not sure what’s causing the issue since the scripts don’t change and my entire scene was duplicated… I also made sure I updated my prefabs as well.
Collision.cs
void StartFinishSequence()
{
GetComponent<Movement>().enabled = false;
if (audioSource.isPlaying)
{
audioSource.Stop();
}
audioSource.PlayOneShot(finish, 1f);
Invoke("NextLevel", levelLoadDelay);
}
void StartCrashSequence()
{
GetComponent<Movement>().enabled = false;
if (audioSource.isPlaying)
{
audioSource.Stop();
}
audioSource.PlayOneShot(crash, 1f);
Invoke("ReloadLevel", levelLoadDelay);
}
Movement.cs:
void ProcessThrust()
{
if (Input.GetKey(KeyCode.Space))
{
rbody.AddRelativeForce(Vector3.up * upwardThrust * Time.deltaTime);
if (!audioSource.isPlaying)
{
audioSource.PlayOneShot(engineThrust, 1f);
}
}
else
{
audioSource.Stop();
}
}