Thread 1: Fatal error: Unexpectedly found nil while unwrapping an Optional value

I’m using SpriteKit in Xcode to make a game. When I run it on a simulator it crashes and highlights this line of code startGame = self .childNode(withName: “startGame”) as ! SKLabelNode. And gives me the error Thread 1: Fatal error: Unexpectedly found nil while unwrapping an Optional value. And when I delete the line of code and run on the simulator, and I click on the Start Game button nothing happens

you don’t have a node that named “startGame” you need to set this up properly as it is trying to find this value

Can you tell me what to write please this is what I have var startGame = SKLabelNode()

uhmm… you should check your asset or board and change the childnode to “startGame”

you should be able to use your app using the original code

startGame = self .childNode(withName: “startGame”) as ! SKLabelNode

maybe check the tutorial where you based it from again to be sure

Thank you! It really helped!

How do you solve the error: Thread 1: signal SIGABRT please help