title: Is there a way to visually see sprite kit's SKPhysicsbody borderline?
body: <p>I am using <code>bodyWithPolygonFromPath</code> to define the volume of a physics body, and I used <a href="http://dazchong.com/spritekit/" rel="nofollow noreferrer">http://dazchong.com/spritekit/</a> to get the paths required. But the path does not seem correct and I wish to see the borderline of the physics body path to see if the shape is correct.</p>
  <p>Is there any way to see the physics body's borderline?</p>
  <p>I tried the following code, but it doesn't work.</p>
  <pre class="lang-objectivec prettyprint-override"><code>ship = [SKSpriteNode spriteNodeWithImageNamed:@&quot;Spaceship&quot;];
  
  CGFloat offsetX = ship.frame.size.width * ship.anchorPoint.x;
  CGFloat offsetY = ship.frame.size.height * ship.anchorPoint.y;
  
  CGMutablePathRef path = CGPathCreateMutable();
  
  CGPathMoveToPoint(path, NULL, 50 - offsetX, 110 - offsetY);
  CGPathAddLineToPoint(path, NULL, 18 - offsetX, 16 - offsetY);
  CGPathAddLineToPoint(path, NULL, 140 - offsetX, 15 - offsetY);
  
  CGPathCloseSubpath(path);
  
  SKShapeNode *yourline = [SKShapeNode node];
  yourline.name = @&quot;yourline&quot;;
  yourline.path = path;
  [yourline setStrokeColor:[UIColor redColor]];
  [self addChild:yourline];
  
  ship.physicsBody = [SKPhysicsBody bodyWithPolygonFromPath:path];
  ship.zRotation = - M_PI / 2;
  </code></pre>