1

I want to fix an SKNode (the node has a physics body) in space by pinning it to the SKScene. So it can participate in the physics simulation - collide, spin, etc. But not move. Is this allowable? Is there a better way to fix an physical node in space yet have it participate in the physics simulation?

dugla
  • 12,774
  • 26
  • 88
  • 136

1 Answers1

0

Yes, you can, by setting dynamic property to NO:

node.physicsBody.dynamic = NO;
nicael
  • 18,550
  • 13
  • 57
  • 90
  • Nicael, but SKScene is inherently edge-based (ie, dynamic = no) so there should be no need to set it explicitly. No? – dugla Oct 22 '14 at 19:22
  • @dugla I mean that you should set this for SKNode... or am I misunderstanding the question? – nicael Oct 22 '14 at 19:23
  • I want an SKNode - SKSpriteNode typically - to be pinned in space using the SKScene as the pin board. So the SKScene is a pin board, each sprite has a pin, I pin the sprite to the pinboard. – dugla Oct 22 '14 at 19:28
  • @dulga So whats wrong with my answer?? Set the `physicsBody.dynamic` of this SKNode to `NO`. – nicael Oct 22 '14 at 19:31