IOS Sprite Kit 2对象碰撞并保持不变

时间:2014-09-13 23:05:28

标签: sprite-kit

我希望同一类别的物体在相互碰撞时不会反弹或移动。我尝试过使用collisionBitMask,contactTestBitMask,质量,密度等等。有谁知道怎么做?

self.physicsBody = [SKPhysicsBody bodyWithRectangleOfSize:self.frame.size];
self.physicsBody.affectedByGravity = NO;
self.physicsBody.allowsRotation = NO;
self.physicsBody.categoryBitMask = CollisionTypeRock;
self.physicsBody.collisionBitMask = CollisionTypeRock;
self.physicsBody.contactTestBitMask = CollisionTypeRock;

感谢。

0 个答案:

没有答案