I am relatively new to Swift and Sprite kit but have ran across an issue where I have changed the physics body of an SKSpriteNode to be:
bucket50.physicsBody = SKPhysicsBody(circleOfRadius: bucket50.size.width / 4.0)
Originally it was -
bucket50.physicsBody = SKPhysicsBody(texture: bucket50.texture!, size: bucket50.texture!.size())
Since making this change the collision detection I have put in place no longer works however as far as I am concerned I have just made the physics body smaller. The ball I am sending towards the bucket does collide but the score isn't registered.
Code is also below that I a using for detection.
func didBegin(_ contact: SKPhysicsContact) {
if contact.bodyA.node?.name == "bucket_50" {
ball.isHidden = true
//Add score for hitting bucket
highScore = highScore + 50
//Display Text
score.text = "Score - \(highScore)"
}
Thanks in advance