contacts not recognized when body is changed from circle to rectangle

前端 未结 1 2018
刺人心
刺人心 2021-01-23 17:31

With help from here I have made a circle body traverse a given path. I have some bodies at some of the path points and have logged contact in didBeginContact. When

相关标签:
1条回答
  • 2021-01-23 17:45

    It seems like when you change the firstBody to a rectangle (in the didBeginContact method), you don't set the bit mask. From what you described, it appears you want to set it to circleCategory as such:

    firstBody.node!.physicsBody?.categoryBitMask = circleCategory
    

    I would put this right below the firstBody.node!.physicsBody?.allowsRotation = false.

    0 讨论(0)
提交回复
热议问题