<!--
{
  "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/init(position:velocity:size:color:lifetime:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Compute Graph"
    ],
    "preciseIdentifier" : "s:12ComputeGraph22ElementSpawnParametersV8position8velocity4size5color8lifetimeACs5SIMD3VySfG_AKs5SIMD2VySfGs5SIMD4VySfGSftcfc"
  },
  "title" : "init(position:velocity:size:color:lifetime:)"
}
-->

# init(position:velocity:size:color:lifetime:)

Creates a new set of particle spawn parameters.

```
init(position: SIMD3<Float>, velocity: SIMD3<Float> = .zero, size: SIMD2<Float> = .init(0.01, 0.01), color: SIMD4<Float> = .init(1, 1, 1, 1), lifetime: Float = 1.0)
```

## Parameters

`position`

The initial 3D position in world space coordinates

`velocity`

The initial velocity vector in world space units per second (defaults to zero)

`size`

The initial size as width and height in world space units (defaults to 0.01 x 0.01)

`color`

The initial RGBA color (defaults to opaque white)

`lifetime`

The particle lifetime in seconds (defaults to 1.0 second)

## Example

```swift
// Create a particle that starts at the origin, moves upward, is red, and lasts 3 seconds
let params = ElementSpawnParameters(
    position: SIMD3<Float>(0, 0, 0),
    velocity: SIMD3<Float>(0, 2, 0),
    size: SIMD2<Float>(0.05, 0.05),
    color: SIMD4<Float>(1, 0, 0, 1),
    lifetime: 3.0
)
```

---

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)