---
title: "initialize::spawnIndex"
framework: Compute Graph
role: symbol
role_heading: Function
platforms: [iOS 27.0+, iPadOS 27.0+, macOS 27.0+, tvOS 27.0+, visionOS 27.0+]
path: computegraph/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.

## Declaration

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

## Discussion

Discussion note:
