I know this is meant to be fairly simple but I just can't figure it out! I have my song playing in the background in sceneOne. I then switch over to sceneTwo and the music completely stops. How can I make the background music continue? Below is my code.
//Music
Music = SKAudioNode(fileNamed: "Verm - Explode.mp3")
self.addChild(Music)
The code above is shown in sceneOne. Please tell me how to continue it into sceneTwo. Thanks everyone. :)
The first scene will be released when transitioning to scene two. And your sound node is a child of the first scene, it is released as well. The right approach is not to retain the sound node across scenes, but to use
AVFoundationframework to play background music. This is also recommended by the SpriteKit documentation. Specifically,AVAudioPlayeris the class you will need. It's api is fairly simple, please check its documentation.