---
title: collisionBitMask
framework: spritekit
role: symbol
role_heading: Instance Property
path: spritekit/skphysicsbody/collisionbitmask
---

# collisionBitMask

A mask that defines which categories of physics bodies can collide with this physics body.

## Declaration

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

## Mentioned in

About Collisions and Contacts

## Discussion

Discussion When two physics bodies contact each other, a collision may occur. This body’s collision mask is compared to the other body’s category mask by performing a logical AND operation. If the result is a nonzero value, this body is affected by the collision. Each body independently chooses whether it wants to be affected by the other body. For example, you might use this to avoid collision calculations that would make negligible changes to a body’s velocity. 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)
- [categoryBitMask](spritekit/skphysicsbody/categorybitmask.md)
- [usesPreciseCollisionDetection](spritekit/skphysicsbody/usesprecisecollisiondetection.md)
- [contactTestBitMask](spritekit/skphysicsbody/contacttestbitmask.md)
- [allContactedBodies()](spritekit/skphysicsbody/allcontactedbodies().md)
