<!--
{
  "availability" : [
    "Reality Composer Pro: -",
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ComputeGraph",
  "identifier" : "/documentation/ComputeGraph/ElementSpawnParameters",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Compute Graph"
    ],
    "preciseIdentifier" : "s:12ComputeGraph22ElementSpawnParametersV"
  },
  "title" : "ElementSpawnParameters"
}
-->

# ElementSpawnParameters

Parameters used to configure the initial state of a particle when it’s spawned in the simulation.

```
struct ElementSpawnParameters
```

## Overview

The values specified become initial values in the Initialization stage, which can read or overwrite
the values.

## Usage

```swift
let params = ElementSpawnParameters(
    position: SIMD3<Float>(0, 1, 0),
    velocity: SIMD3<Float>(0, -1, 0),
    size: SIMD2<Float>(0.02, 0.02),
    color: SIMD4<Float>(1, 0.5, 0, 1),
    lifetime: 2.0
)
```

## Topics

### Initializers

[`init(position: SIMD3<Float>, velocity: SIMD3<Float>, size: SIMD2<Float>, color: SIMD4<Float>, lifetime: Float)`](/documentation/ComputeGraph/ElementSpawnParameters/init(position:velocity:size:color:lifetime:))

Creates a new set of particle spawn parameters.

### Instance Properties

[`var color: SIMD4<Float>`](/documentation/ComputeGraph/ElementSpawnParameters/color)

The initial color and alpha (transparency) of the particle.

[`var lifetime: Float`](/documentation/ComputeGraph/ElementSpawnParameters/lifetime)

The initial lifetime of the particle in seconds.

[`var position: SIMD3<Float>`](/documentation/ComputeGraph/ElementSpawnParameters/position)

The initial 3D position of the particle in world space coordinates.

[`var size: SIMD2<Float>`](/documentation/ComputeGraph/ElementSpawnParameters/size)

The initial size of the particle as a 2D vector representing width and height.

[`var velocity: SIMD3<Float>`](/documentation/ComputeGraph/ElementSpawnParameters/velocity)

The initial velocity vector of the particle in world space units per second.

## Relationships

### Conforms To

[`Sendable`](/documentation/Swift/Sendable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

---

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)