Answer the question
In order to leave comments, you need to log in
How to fix button sound playing during scene transition?
How can I make it so that while the fade animation is playing, the button cannot be pressed, or that during the animation the button sound is no longer emitted after 1 time?
public Image black;
public Animator sceneTransition;
public AudioSource buttonSound;
public void LoadEasyGameScene()
{
buttonSound.Play();
StartCoroutine(Fading());
}
IEnumerator Fading()
{
sceneTransition.SetTrigger("end");
yield return new WaitForSeconds(0.99f);
SceneManager.LoadScene(1);
PlayerPrefs.SetInt("easy", 1);
PlayerPrefs.Save();
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question