---
title: "addModifier(forProperties:at:modifier:)"
framework: scenekit
role: symbol
role_heading: Instance Method
path: "scenekit/scnparticlesystem/addmodifier(forproperties:at:modifier:)"
---

# addModifier(forProperties:at:modifier:)

Adds a block that modifies particle properties, to be executed each time SceneKit renders a frame.

## Declaration

```swift
func addModifier(forProperties properties: [SCNParticleSystem.ParticleProperty], at stage: SCNParticleModifierStage, modifier block: @escaping SCNParticleModifierBlock)
```

## Parameters

- `properties`: An array containing one or more of the constants listed in Particle Property Keys, each of which specifies a property of the appearance or behaviors of particles in the particle system.
- `stage`: The stage of SceneKit’s particle simulation during which to call the block. See doc://com.apple.scenekit/documentation/SceneKit/SCNParticleModifierStage for allowed values.
- `block`: A doc://com.apple.scenekit/documentation/SceneKit/SCNParticleModifierBlock block to be called every time SceneKit renders a frame. In this block you can modify the properties of all particles in the system.

## Discussion

Discussion By associating a block with one or more particle properties, you can run arbitrary code that modifies those properties during each frame of animation. This option provides maximum flexibility for changing the appearance or behavior of particles over time. important: Running your own code to update particle properties every frame can have a severe impact on rendering performance. If the behavior over time that you want for your particle system can be described more declaratively, use the propertyControllers property and SCNParticlePropertyController class instead. If you need to change particle properties only at certain times (rather than continuously), add a handler block for an event using the handle(_:forProperties:handler:) method.

## See Also

### Related Documentation

- [handle(_:forProperties:handler:)](scenekit/scnparticlesystem/handle(_:forproperties:handler:).md)

### Modifying Particles Over Time

- [propertyControllers](scenekit/scnparticlesystem/propertycontrollers.md)
- [removeModifiers(at:)](scenekit/scnparticlesystem/removemodifiers(at:).md)
- [removeAllModifiers()](scenekit/scnparticlesystem/removeallmodifiers().md)
- [SCNParticleSystem.ParticleProperty](scenekit/scnparticlesystem/particleproperty.md)
- [SCNParticleModifierStage](scenekit/scnparticlemodifierstage.md)
- [SCNParticleModifierBlock](scenekit/scnparticlemodifierblock.md)
