Why Contact Delegate isn't called in SceneKit?

2019-07-11 03:30发布

问题:

I'm developing a game and I'm facing an issue with the contact delegate in SceneKit. I declared the right delegate in the ViewController and used this to set the delegate:

    sceneView.scene?.physicsWorld.contactDelegate = self

It should work and in fact, it does, with the XCode 6.4 but with the beta XCode 7 it doesn't. The same code. My question is: does anyone here is able to know a temporary fix for it?

回答1:

starting in iOS9, you have to explicitly configure the "contactTestBitMask" of your physicsBody to get contact notifications.