title: Why is my custom Swift class not transferring to my GameScene
body: <p>I want to be able to access my custom class in my game scene. I followed the directions at: <a href="http://spritekitlessons.com/how-to-write-your-own-custom-classes-in-sprite-kit/" rel="nofollow noreferrer">http://spritekitlessons.com/how-to-write-your-own-custom-classes-in-sprite-kit/</a></p>
  <p>First I create a new file called Player.swift, I make sure its targeted into my project folder</p>
  <p>then I add this custom class</p>
  <pre><code>import Foundation
  import SpriteKit
  
  class Player: SKSpriteNode {
      let walkingActive = 0 
  }
  
  </code></pre>
  <p>But when I try to access it in my gameScene</p>
  <pre><code>class GameScene: SKScene, SKPhysicsContactDelegate {
  
      var thePlayer: Player = Player()
  
   }
  </code></pre>
  <p>I get the error: <strong>Use of undeclared type 'Player'</strong></p>
  <p>if I try to instantiate the class with a type that isn't being recognized like this</p>
  <pre><code> if let somePlayer:Player = self.childNode(withName: &quot;Player&quot;) as? Player {
                 //make the declared variable equal to somePlayer
                 thePlayer = somePlayer
      
             }
  </code></pre>
  <p>I get the errors:</p>
  <p><strong>Initializer for conditional binding must have Optional type, not '&lt;&gt;'</strong></p>
  <p><strong>Use of undeclared type 'Player'</strong></p>
  <p>I'm following the guide exactly and i've found another resource which tells me to do the exact same thing. So I don't understand what I'm doing wrong.</p>
  <p>Would appreciate any help! Thanks</p>
  <p>Here are pictures of exactly what I'm doing for clarity</p>