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

# initialize

Nodes usable within the initialization stage of an element.

## Topics

### Functions

[`uint initialize::sourceElementIndex()`](/documentation/ComputeGraph/initialize/sourceElementIndex)

When initializing a new particle from an event triggered from another
particle, this returns the source particle’s index with its system.

[`int initialize::spawnIndex()`](/documentation/ComputeGraph/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.

---

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)