I am trying to play the sound of the button click before loading the scene in unity. However, the sound is never played. Below is my code, help would be appreciated.
public void RestartGame()
{
audioManager.PlaySound(forwardSound);
StartCoroutine(DelaySceneLoad("Gameplay"));
}
IEnumerator DelaySceneLoad(string scene)
{
yield return new WaitForSeconds(forwardSound.length);
GameTracker.SetGameOver(false);
SceneManager.LoadScene(scene);
}
audioManager
code so we can check for errors there? \$\endgroup\$