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

# categoryBitMask

A mask that defines which categories this light belongs to.

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

## Discussion

Every light in a scene can be assigned to up to 32 different categories, each corresponding to a bit in the bit mask. SpriteKit does not predefine any lighting categories, so it is up to you to define which values are used in your game. When a scene is rendered, a light’s [`categoryBitMask`](/documentation/SpriteKit/SKLightNode/categoryBitMask) property is compared to each sprite node’s [`lightingBitMask`](/documentation/SpriteKit/SKSpriteNode/lightingBitMask), [`shadowCastBitMask`](/documentation/SpriteKit/SKSpriteNode/shadowCastBitMask), and [`shadowedBitMask`](/documentation/SpriteKit/SKSpriteNode/shadowedBitMask) properties to determine whether that sprite interacts with the light.

The default value is `0x00000001`.

---

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)