title: SpriteKit: How to create Basic Physics Joints
body: <p>I am trying to create simple Joints between two SKPhysicsBodies. But, they are acting weirdly.
  I am well aware of the fact the anchor points should be on scene coordinate. Please have a look at the Source code attached.</p>
  
  <p>For Example this is how a fixed Joint results after attaching a small square on a rectangle.</p>
  
  <pre><code>-(void)createFixedJointOnScene:(SKScene*)scene
  </code></pre>
  
  <p>{</p>
  
  <pre><code>//Adding Rectangle
  
      SKSpriteNode* backBone = [[SKSpriteNode alloc] initWithColor:[UIColor whiteColor] size:CGSizeMake(20, 200)];
  backBone.position = CGPointMake(CGRectGetWidth(self.frame)/2.0, CGRectGetHeight(self.frame)/2.0);
  backBone.physicsBody = [SKPhysicsBody bodyWithRectangleOfSize:backBone.size];
  backBone.physicsBody.categoryBitMask = GFPhysicsCategoryRectangle;
  backBone.physicsBody.collisionBitMask = GFPhysicsCategoryWorld;
  [scene addChild:backBone];
  
  //Adding Square
  SKSpriteNode* head = [[SKSpriteNode alloc] initWithColor:[SKColor grayColor] size:CGSizeMake(40, 40)];
  head.physicsBody = [SKPhysicsBody bodyWithRectangleOfSize:head.size];
  head.position = CGPointMake(backBone.position.x, backBone.position.y-40);
  head.physicsBody.categoryBitMask = GFPhysicsCategorySquare;
  head.physicsBody.collisionBitMask = GFPhysicsCategoryWorld;
  [scene addChild:head];
  
  //Pinning Rectangle and Square
  NSLog(@"Head position %@", NSStringFromCGPoint(head.position));
  SKPhysicsJointFixed* pin =[SKPhysicsJointFixed jointWithBodyA:backBone.physicsBody bodyB:head.physicsBody anchor:head.position];
  [self.physicsWorld addJoint:pin];
  </code></pre>
  
  <p>}</p>
  
  <p><img src="https://i.stack.imgur.com/sDcsX.png" alt="enter image description here"></p>
  
  <p><a href="https://dl.dropboxusercontent.com/u/62559842/PhysicsTest.zip" rel="noreferrer">https://dl.dropboxusercontent.com/u/62559842/PhysicsTest.zip</a></p>
  
  <p>Thank you.</p>