Search code examples
swiftvisionosvision-proreality-composer-pro

How to disable loop for ParticleEmitterComponent on visionOS?


In Reality Composer Pro there is a flag to toggle the loop of the particle system. In code I couldn't find a .loop value on the ParticleEmitterComponent - does anyone know how else I can disable the looping there?


Solution

  • To disable the loop you have to set the .timing value to once like this:

    var particles = ParticleEmitterComponent()
    particles.timing = .once(warmUp: 0, emit: .init(duration: 1))