Search Unity

[PARTICLES] Following the documentation example leads to "Do not create your own module instances"

Discussion in 'Scripting' started by Setsuki, Feb 7, 2019.

  1. Setsuki

    Setsuki

    Joined:
    Aug 21, 2012
    Posts:
    31
    EDIT : I think due to changing Unity versions, my particle system was set to self destruct when over istead of disable. The error message was due to the gameObject being null.


    Hello !
    I have a script that heavily uses Coroutines. Through a coroutine of coroutine, the following code gets executed :
    Code (CSharp):
    1. var emission = myParticleSystem.emission;
    2. emission.rateOverTimeMultiplier = Mathf.Lerp(0,15,myValue);
    When executing this code, Do not create your own module instances, get them from a ParticleSystem instance is thrown.

    Copying the example from the documentation works, which leads me to believe this has to do with coroutines (I am still testing in that regard)

    Getting the emission module on Start() or Awake() doesn't change the problem.
     
    Last edited: Feb 7, 2019