class GameScene: SKScene, SKPhysicsContactDelegate {
func didBegin(_ contact: SKPhysicsContact) {
let contactA:SKPhysicsBody = contact.bodyA
let contactB:SKPhysicsBody = contact.bodyB
if contactA.contactTestBitMask == 1 && contactB.contactTestBitMask == 2 {
jumpButtonIsReady = true
print("player landed on ground1")
}
if contactA.contactTestBitMask == 2 && contactB.contactTestBitMask == 1 {
jumpButtonIsReady = true
print("player landed on ground1")
} }
}
I have used scene editor to set the contactTestBitMask of player to be 1 and the ground to be 2. they are both set to dynamic is true. But the contact is not registering. Thanks for any help.