Adds a block that modifies particle properties, to be executed at a specified event in the lifetimes of particles in the system.
- iOS 8.0+
- macOS 10.10+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 3.0+
The event at which to call the block. See
SCNParticlefor allowed values.
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.
SCNParticleblock to be called every time SceneKit renders a frame. In this block you can modify the properties of particles in the system.
By associating a block with one or more particle properties, you can run arbitrary code that modifies those properties when a significant event in the particle simulation occurs for one or more particles. For example, you can use the following code with a confetti effect to randomly switch between two distinct colors for each spawned particle: