#Calling .Emit(1) on a ParticleSystem spawns more than 1 particle

1 messages · Page 1 of 1 (latest)

carmine cliff
#

I have a ParticleSystem set up to not emit anything naturally. In a MonoBehavior on the object the ParticleSystem is attached to I call .Emit(1) on the ParticleSystem several times in a method called via InvokeRepeating().

/// <summary>
/// Removes the topmost droplet from the beaker and scores it
/// </summary>
    void ScoreDroplet()
    {
        // [...]

        var EmitParams = new ParticleSystem.EmitParams();
        Vector4 color = topColor.getColor();
        EmitParams.startColor = Util_CATACLYST.color32FromFloat4(color);

        Debug.Log("EMITTING");

        dropletParticleSys.Emit(1);
    }
// called via InvokeRepeating("ScoreDroplet", 0.1f, 0.1f);```
In this example you can see that the method is only invoked once (`EMITTING` is only logged once), causing one particle to be emitted, but after a delay several more particles are emitted. What is causing this and how do I avoid it?
carmine cliff
#

Just realized I wasn't passing in the EmitParmeters to Emit. Fixed that, issue still occurs