<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "SpriteKit",
  "identifier" : "/documentation/SpriteKit/SKPhysicsBody/categoryBitMask",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "SpriteKit"
    ],
    "preciseIdentifier" : "c:objc(cs)SKPhysicsBody(py)categoryBitMask"
  },
  "title" : "categoryBitMask"
}
-->

# categoryBitMask

A mask that defines which categories this physics body belongs to.

```
var categoryBitMask: UInt32 { get set }
```

## Discussion

Every physics body in a scene can be assigned to up to 32 different categories, each corresponding to a bit in the bit mask. You define the mask values used in your game. In conjunction with the [`collisionBitMask`](/documentation/SpriteKit/SKPhysicsBody/collisionBitMask) and [`contactTestBitMask`](/documentation/SpriteKit/SKPhysicsBody/contactTestBitMask) properties, you define which physics bodies interact with each other and when your game is notified of these interactions.

The default value is `0xFFFFFFFF` (all bits set).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)