Two questions: 1) you need to add nodes containing physical bodies to the scene before they connect to the joint, and 2) you need to connect nodes with a minimum value of Y not at most (if you want to behave as shown in diagram), since the scene origin is the bottom / left viewing angle, and positive Y is up.
// Do this prior to adding the joint to the world self.addChild(object1) self.addChild(object2) // Create joint between two objects. Edit: changed MaxY to MinY to attach bodies // at bottom of the nodes var myJoint = SKPhysicsJointPin.jointWithBodyA(object1.physicsBody, bodyB: object2.physicsBody, anchor: CGPoint(x: CGRectGetMaxX(self.object1.frame), y: CGRectGetMinY(self.object2.frame))) self.physicsWorld.addJoint(myJoint)
source share