<!--
{
  "availability" : [
    "Reality Composer Pro: -",
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "ComputeGraph",
  "identifier" : "/documentation/ComputeGraph/initialize/spawnIndex",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Compute Graph"
    ],
    "preciseIdentifier" : "initialize::spawnIndex"
  },
  "title" : "initialize::spawnIndex"
}
-->

# initialize::spawnIndex

For a derived element spawned from an emitter, returns the sequential index of
the spawn from that emitter. If this was spawned from an EventSource or from the CPU,
this value is the index within the current spawn request.

```
int initialize::spawnIndex()
```

## Discussion> Visual: ![Graph](initialize__spawnIndex)

---

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)