How to carry over button sound to another scene
Hey guys, I added a sound for my “play” button, which loads my level scene, but the sound that gets played when the button is pressed is cut short by the loading of the next scene. What’s the best way to get around this issue? Thanks!
P.S. I didn't use coding to play the sounds and I have looked into DontDestroyOnLoad but prefer a non-coding method if possible since the sounds are played without codes.
Answer by tormentoarmagedoom · Aug 08, 2018 at 12:54 PM
Good day.
First, your non coding desire is the worst enemy for game developing...
You only need to delay the scene loading. You have corrutines and Invoke() to do it.
Good luck
Hi, I used the following, but I can't seem to get me Restart function called. The debug for PlayAgain is called but not the Restart. Do you know why? Thank you
public void PlayAgain() { Debug.Log("PlayAgain"); Invoke("Restart", 0.25f); } void Restart() { Debug.Log("restart"); Scene$$anonymous$$anager.LoadScene(Scene$$anonymous$$anager.GetActiveScene().buildIndex); }
Your answer
![](https://koobas.hobune.stream/wayback/20220612172426im_/https://answers.unity.com/themes/thub/images/avi.jpg)