---
title: categoryBitMask
framework: spritekit
role: symbol
role_heading: Instance Property
path: spritekit/skphysicsbody/categorybitmask
---

# categoryBitMask

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

## Declaration

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

## Mentioned in

About Collisions and Contacts

## Discussion

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 and 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).

## See Also

### Working with Collisions and Contacts

- [About Collisions and Contacts](spritekit/about-collisions-and-contacts.md)
- [collisionBitMask](spritekit/skphysicsbody/collisionbitmask.md)
- [usesPreciseCollisionDetection](spritekit/skphysicsbody/usesprecisecollisiondetection.md)
- [contactTestBitMask](spritekit/skphysicsbody/contacttestbitmask.md)
- [allContactedBodies()](spritekit/skphysicsbody/allcontactedbodies().md)
