Is it possible to deactivate collisions in physics bodies in spriteKit?

前端 未结 4 1928
栀梦
栀梦 2020-12-09 19:12

I\'m looking at doing the best way to collect items with my hero in my spriteKit game for iOs, and after to try a few ways to do it, my conclusion is the best way would be t

4条回答
  •  执念已碎
    2020-12-09 19:25

    Short answer:

    yourHero.physicsBody.collisionBitMask = 0;
    

    The default value of collisionBitMask is 0xFFFFFFFF (all bits set), that's why the node collides with others

提交回复
热议问题