<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/ComputeGraphComponent/spawn(element:in:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "RealityKit",
      "ComputeGraph",
      "_RealityKit_ComputeGraph"
    ],
    "preciseIdentifier" : "s:24_RealityKit_ComputeGraph0cD9ComponentV5spawn7element2iny0cD022ElementSpawnParametersV_SiSgtF"
  },
  "title" : "spawn(element:in:)"
}
-->

# spawn(element:in:)

Spawns a new element in the particle simulation.

```
mutating func spawn(element: ElementSpawnParameters, in system: ComputeNodeGraph.NodeID? = nil)
```

## Parameters

`element`

The spawn parameters defining the properties of the element to create

`system`

The ID of the specific system to spawn the element in. When `nil`,
all systems will be asked to spawn the same element.

## Discussion

This method queues an element to be spawned during the next simulation update.
The spawning is deferred and batched for performance reasons.

> Note: The actual spawning occurs during the simulation update cycle.

---

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)