Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question particle system controll is wierd

Discussion in 'Scripting' started by zaicev9797, Oct 6, 2022.

  1. zaicev9797

    zaicev9797

    Joined:
    Apr 18, 2022
    Posts:
    2
    This
    Code (CSharp):
    1.   ParticleSystem.EmissionModule em = _particleSystem.emission;
    2.         em.rateOverTime = _initialEmission * intensity;
    shows me error:
    Code (CSharp):
    1. : Do not create your own module instances, get them from a ParticleSystem instance
    almost the same code is in a scripting reference. And even more. Almost the same code in other place in my project works perfectly well.

    What is wrong? How can I fix it?
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,970
  3. zaicev9797

    zaicev9797

    Joined:
    Apr 18, 2022
    Posts:
    2
    I've just noticed NRE... my fault
     
    Kurt-Dekker likes this.