I've placed a Color Sprite in GameScene.sks and named it line1LightLeft and gave it the texture named arrowLeftOff.
Now I want the image to change in GameScene.swift. So I first want to connect the node in the .sks to the .swift.
var line1LightLeft = SKSpriteNode()
override func didMove(to view: SKView) {
line1LightLeft = self.childNode(withName: "arrowLeftOff") as! SKSpriteNode
}
I don't get any errors but when I build and run the game I get the message: fatal error: unexpectedly found nil unwrapping an Optional value
The line of code with self.childNode in it turns red and it says: Thread 1: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)
Off course I've tried Google but the answers I find don't change it or even give more errors. Does anyone see an error?
Grrrr, why can't I ctrl-click-drag just like in a single view application?