Search code examples
ios8sprite-kitskscenesknode

SKSpriteKit. Can the SKScene be used as a physical body to pin an SKNode?


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?


Solution

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

    node.physicsBody.dynamic = NO;