title: Scene kit (Swift): Unhide or re-add hidden / removed nodes
body: <p>I'm trying to create a game in which someone taps a box, which makes it disappear. My problem is with 'restarting' the game and re-adding all previously hidden / removed boxes.</p>
  
  <p>I create a row of boxes like so: </p>
  
  <pre><code>func addBoxes() {
  
      for _ in 0..&lt;5 {
  
          let sphereGeometry = SCNBox(width: 1, height: 1, length: 1, chamferRadius: 0)
          let sphereNode: SCNNode! = SCNNode(geometry: sphereGeometry)
          sphereNode.position = SCNVector3(x: x, y: y, z: z)
  
          scnScene.rootNode.addChildNode(sphereNode)
  }
  </code></pre>
  
  <p>After which I update the position of x, y and z of course.</p>
  
  <p>This all works beautifully, and I hide a tapped box like so:</p>
  
  <pre><code>override func touchesBegan(_ touches: Set&lt;UITouch&gt;, with event: UIEvent?) {
  
      let touch = touches.first!
      let location = touch.location(in: scnView)
      let hitResults = scnView.hitTest(location, options: nil)
  
      if let result = hitResults.first {
  
          let node = result.node
          node.isHidden = true
      }
  }
  </code></pre>
  
  <p>After all boxes are tapped and hidden, the game should simply reset for now, so unhide all boxes:</p>
  
  <pre><code>func newGame() {
  
      // I've tried this and various versions of it, with no success
      for child in scnScene.rootNode.childNodes {
  
          child.isHidden = false
      }
  }
  </code></pre>
  
  <p>However, this gives me:</p>
  
  <pre><code>fatal error: unexpectedly found nil while unwrapping an Optional value
  </code></pre>
  
  <p>I've also tried <code>child.removeFromParentNode()</code> and then tried to re-add the nodes to the scene, but this throws the same error.</p>
  
  <p>Can anyone point me in the right direction here? How can I unhide one or all nodes which are created in the for loop?</p>