Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
SpriteKit problem
-
Hello, I am opening this topic once again since I still didn't get solution. Basically i’m trying to set contactDelegate on physicsWorld of SKScene that’s created through create_objc_class but it doesn’t work. Any ideas? Thanks in advance.
Here is full code:
https://gist.github.com/anonymous/2530353b2a41c19746bf9c0e0fa9a57fNote:
The code is basically modified version of this:
https://github.com/jbking/pythonista-misc/blob/master/spritekit/skview-demo.py -
node.physicsBody().contactTestBitMask=1
in two places (end of your shape creation functions) solves the issue.
contactTestBitMask is mentioned in the description of https://developer.apple.com/documentation/spritekit/skphysicscontactdelegate , and looking at the description shows that it is a way of only responding to contacts that you care about.
-
@JonB said:
node.physicsBody().contactTestBitMask=1
in two places (end of your shape creation functions) solves the issue.
contactTestBitMask is mentioned in the description of https://developer.apple.com/documentation/spritekit/skphysicscontactdelegate , and looking at the description shows that it is a way of only responding to contacts that you care about.
Thank you so much for your help! I highly appreciate it, and it’s that situation when code wasn’t working because of simple mistake.