Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. Unity 2020.2 has been released.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Changing Particle texture in particle system in c#

Discussion in '2D' started by JelleTorres, Feb 13, 2020.

  1. JelleTorres


    Apr 25, 2018
    I have 1 particle system and 4 different sprites
    Depending on some input in want to change the shape op the particles trough script.

    At this time I can set the shape of the particle by dragging one of the sprites in to the particle texture (shader: mobile/particles/Additive) SEE IMAGE*
    I could make 4 different particle systems but that doesn't scale very wel if I want to add more or if I want to change the properties of the all particle systems.

    id like to do something like:

    public Sprite[] imgs;
    public Gameobject particleSystem;

    public void SetParticleShape(int n)
    Gameobject obj = instanciaste(particleSytem, transform.position, quarternion.identity);
    obj.SHADER_TEXTURE = imgs[n];

    Schermafbeelding 2020-02-13 om 17.45.41.png

    Attached Files:

    Last edited: Feb 13, 2020