Post

Replies

Boosts

Views

Activity

SKPhysicsContact detect the contact not expecting
Here is my code:func didBegin(_ contact: SKPhysicsContact) { print("contact.bodyA.categoryBitMask:::\(contact.bodyA.categoryBitMask)") print("contact.bodyA.contactTestBitMask:::\(contact.bodyA.contactTestBitMask)") print("contact.bodyA.isDynamic:::\(contact.bodyA.isDynamic)") print("contact.bodyB.categoryBitMask:::\(contact.bodyB.categoryBitMask)") print("contact.bodyB.contactTestBitMask:::\(contact.bodyB.contactTestBitMask)") print("contact.bodyB.isDynamic:::\(contact.bodyB.isDynamic)")and I got the result:contact.bodyA.categoryBitMask:::1 contact.bodyA.contactTestBitMask:::9 contact.bodyA.isDynamic:::true contact.bodyB.categoryBitMask:::5 contact.bodyB.contactTestBitMask:::8 contact.bodyB.isDynamic:::falseI found the contact nodes are not collected by its categoryBitMask and contactTestBitMask. I mean A's categoryBitMask not match B's contactTestBitMask, but their contact can be detect.Somebody tell me why, and how can I optimize the SKPhysicsContact.
3
0
653
Dec ’19