Why Contact Delegate isn't called in SceneKit?

2019-07-11 03:02发布

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条回答
Bombasti
2楼-- · 2019-07-11 03:16

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

查看更多
登录 后发表回答