Search Unity

How to stop particles?

Discussion in 'Project Tiny' started by developer_plus_bliss, Apr 8, 2019.

  1. developer_plus_bliss

    developer_plus_bliss

    Joined:
    Jan 10, 2017
    Posts:
    7
    Is there an option in project Tiny to not looping particles, just setting a duration? or there is a way to Stop/Play particles by code?
     
  2. Rupture13

    Rupture13

    Joined:
    Apr 12, 2016
    Posts:
    78
    Adding the BurstEmission component from the Particles Family to your Particle System in the Inspector, you can set it up so it won't loop.

    Via code you can set the emitRate of the
    ut.Particles.ParticleEmitter
    component to 0 to smoothly make it stop playing particles. If you save the value before you set it to 0 in a component somewhere, you can later "start/resume" the particle playing by setting the same emitRate to the original value you saved.