Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

How to stop particles?

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

  1. developer_plus

    developer_plus

    Joined:
    Jan 10, 2017
    Posts:
    10
    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:
    129
    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.