title: Swift Sprite Nodes Colliding
body: <p>I want to enable two SKSpriteNodes to pass through one another.  From my understanding the following code should do the trick:</p>
  
  <pre><code>        beam?.physicsBody = SKPhysicsBody(rectangleOf: CGSize(width: beam!.size.width - 40, height: beam!.size.height/4));
          beam?.physicsBody?.categoryBitMask = ColliderType.BEAM;
          beam?.physicsBody?.contactTestBitMask = ColliderType.ENEMY;
          beam?.physicsBody?.collisionBitMask = 0;
          beam?.physicsBody?.affectedByGravity = false;
          beam?.physicsBody?.allowsRotation = false;
  
          item?.physicsBody?.categoryBitMask = ColliderType.CRATES;
          item?.physicsBody?.contactTestBitMask = ColliderType.PLAYER;
          item?.physicsBody?.collisionBitMask = ColliderType.GROUND;            
          item?.physicsBody?.affectedByGravity = true;
          item?.physicsBody?.allowsRotation = false;
  </code></pre>
  
  <p>As neither should be picked up by the by the other's collider type.  I have tried many different methods already including setting their collision bit masks to 0.  </p>
  
  <p>When the two nodes collide the item moves below the beam. Then when the beam disappears the item moves back into its original place.  The item must remain dynamic to other nodes, but advice on this topic is greatly appreciated. Thanks.</p>
  
  <pre><code>struct ColliderType {
  static let PLAYER: UInt32 = 0;
  static let GROUND: UInt32 = 1;
  static let CRATES: UInt32 = 2;
  static let BULLET: UInt32 = 3;
  static let ENEMY: UInt32 = 4;
  static let EXPLOSION: UInt32 = 5;
  static let UFO: UInt32 = 6;
  static let UFOBOMB: UInt32 = 7;
  static let SHIELD: UInt32 = 8;
  static let BEAM: UInt32 = 9;
  }
  </code></pre>