Sprite-Kit registering multiple collisions for single contact

OK – it would appear that a simple: if bomb == nil {return} is all that’s required. This should be added as follows: let bomb = contact.bodyA.categoryBitMask == category.bomb.rawValue ? contact.bodyA.node : contact.bodyB.node if bomb == nil {return} This works to prevent multiple collisions for a node that you removeFromParent in didBeginContact. If you don;t … Read more

Sprite Kit pin joints appear to have an incorrect anchor

I also had this issue and the cause is setting the physics body before setting the sprites position. carNode.physicsBody = [SKPhysicsBody bodyWithRectangleOfSize:carNode.size]; carNode.position = CGPointMake(CGRectGetMidX(self.frame), CGRectGetMidY(self.frame)); Change the above to carNode.position = CGPointMake(CGRectGetMidX(self.frame), CGRectGetMidY(self.frame)); carNode.physicsBody = [SKPhysicsBody bodyWithRectangleOfSize:carNode.size]; It should work. Thanks Smick. SpriteKit: How to create Basic Physics Joints

SKPhysicsBody and [SKNode setScale:]

Using either an SKAction or the Update loop, you can create a new SKPhysicsBody with the proper scale and apply it to the object. However, by doing so, you will lose the velocity. To fix this, you can do the following: SKPhysicsBody *newBody = [SKPhysicsBody bodyWithRectangleOfSize:boxObject.size]; newBody.velocity = boxObject.physicsBody.velocity; boxObject.physicsBody = newBody;