Community Q&A

Where Wwise users help each other out!

Audiokinetic's Community Q&A is the forum where Wwise users ask and answer questions within the Wwise community. If you would like to get an answer from Audiokinetic's Technical support team, make sure you use the Support Tickets page.

How to make a music Wwise Event not to duplicate when the scene reloads in Unity

0 votes
Hi, I'm trying to have the music play continuously even though I restart the game. The problem is that when I hit restart the music duplicates and overlaps. I would like to have the music play once even though I hit restart. I have this music in Wwise and it integrates in Unity. In my game manager script to restart I have this scenemanager.loadscene phrase so I don't know what to write so that the music plays once.

I would appreciate if someone could solve this problem.

Regards.
asked Jan 7 in General Discussion by Mitchell K. (100 points)

1 Answer

0 votes

Hi Mitchell, 

There's a couple of ways to do this. One would be to use the DontDestroyOnLoad() function on the object you posted your music on. 
Another one could be to have a separate scene that is always maintained. For instance, you could have a "Main" Scene that keeps track of e.g. process stats. If that scene is always loaded, then that would be great for playing music across scenes loaded additively

Let us know if you get it to work!

answered 4 days ago by Mads Maretty S. (Audiokinetic) (9,130 points)
...