<!--
{
  "availability" : [
    "iOS: 8.0.0 - 26.0.0",
    "iPadOS: 8.0.0 - 26.0.0",
    "macCatalyst: 13.1.0 - 26.0.0",
    "macOS: 10.8.0 - 26.0.0",
    "tvOS: 9.0.0 - 26.0.0",
    "visionOS: 1.0.0 - 26.0.0",
    "watchOS: 3.0.0 - 26.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "SceneKit",
  "identifier" : "/documentation/SceneKit/SCNNode/categoryBitMask",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "SceneKit"
    ],
    "preciseIdentifier" : "c:objc(cs)SCNNode(py)categoryBitMask"
  },
  "title" : "categoryBitMask"
}
-->

# categoryBitMask

A mask that defines which categories the node belongs to.

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

## Discussion

You can assign each node in a scene to one or more categories, where each category corresponds to a bit in the bit mask. You define the mask values used in your app. When SceneKit renders a scene, it compares each node’s [`categoryBitMask`](/documentation/SceneKit/SCNNode/categoryBitMask) property with the category bit masks of every other object that participates in the rendering process—lights, cameras, and techniques—using a bitwise AND operation. If the result is a nonzero value, SceneKit includes the node when rendering. The default category bit mask is `1`.

Use a node’s category bit mask together with:

- An [`SCNLight`](/documentation/SceneKit/SCNLight) object’s [`categoryBitMask`](/documentation/SceneKit/SCNLight/categoryBitMask) property to exclude the node from that light’s illumination
- An [`SCNCamera`](/documentation/SceneKit/SCNCamera) object’s [`categoryBitMask`](/documentation/SceneKit/SCNCamera/categoryBitMask) property to make the node invisible to that camera
- The category bit masks in an [`SCNTechnique`](/documentation/SceneKit/SCNTechnique) object’s definition dictionary to include or exclude the node from phases of a multipass rendering technique

> Note:
> This property doesn’t affect SceneKit’s physics simulation. To include or exclude a node from physics interactions, use the ``doc://com.apple.scenekit/documentation/SceneKit/SCNPhysicsBody/categoryBitMask`` property of the node’s ``doc://com.apple.scenekit/documentation/SceneKit/SCNNode/physicsBody`` and ``doc://com.apple.scenekit/documentation/SceneKit/SCNNode/physicsField`` objects.

---

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)