SKAudionode and Swift3

107 Views Asked by At

it been a year since I open my Xcode project and I see that there are some errors.

Now I'm having problem with my audio code. it use to work good a year ago but now it says "fatal error: unexpectedly found nil while unwrapping an Optional value"

sample

1

There are 1 best solutions below

0
On

Try doing something like this

   self.run(SKAction.playSoundFileNamed("MexicanPause.wav", waitForCompletion: false))

I don't know where you're trying to implement your code, but this can be add in touchesBegan or maybe even touchesEnded.