I've got a Main Menu setup along with an audio track that loops. For some reason though, when the player clicks on "New Game", the audio starts skipping repeatedly until the game is loaded. Has anybody experienced any similar issues? How might I ensure that the audio doesn't skip while a level is loading? Any help would be very much appreciated! Thank you!
asked Nov 21 '11 at 06:50 PM
Yeah, sometimes loading levels takes forever, and it can mess up music and that sucks. You can try AsyncLevelLoad to see if it helps by making some of the loading happen while the game is playing (it usually doesn't help much though, because it doesn't preload assets, it just streams in the scene itself), but you should consider fading the music out before loading as your simplest solution.
...If you really want great level loading though, you'll actually have to preload assets yourself - often what makes loading a level suck is not actually getting to the level, it's rendering/playing the first frame, where it needs to get all the textures and sounds and stuff. If you have an editor script that builds a list of all the textures and sounds needed for a scene, you can make a preloader for that level that assigns the textures to an offscreen object in batches and that assigns the sounds to an audio source and accesses the data to force loading before the scene is loaded, and that should fix most of the problem.
answered Nov 21 '11 at 10:27 PM