So i've created a code that creates a line of unlimited size by touch and i'm wondering how to restrict the size such that the beginning and end of the line can be a small distance to a maximum set distance apart? The code i used was: pathToDraw = CGPathCreateMutable(); CGPathMoveToPoint(pathToDraw, NULL, positionInScene.x, positionInScene.y); lineNode = [SKShapeNode node]; lineNode.path = pathToDraw; lineNode.zPosition = 1000; lineNode.strokeColor = [SKColor blueColor]; lineNode.physicsBody = [SKPhysicsBody bodyWithEdgeLoopFromPathathToDraw]; lineNode.physicsBody.categoryBitMask = ballCategory; lineNode.physicsBody.contactTestBitMask = ballCategory; [self addChild:lineNode]; I used this in the touch began and touch Moved method,