Animate particlesystem for seamless looping

Hi guys,
i was wondering if there is a way to create a seamless particle animation, which can be played in a loop.
Need this for animating smog on mobile, by creating a texture animation.

If unity does not support this, are there any programms / librarys where you can create such seamless animations?

Thanks!

Yes it should be possible. Use a looping particle system and make sure you set the system’s random seed to a non zero value using a script.

1 Like

Thanks for your replay, i already tried that, setting the random seed property to 1.

void Awake(){
particles.randomSeed = 1;
particles.GetComponent().Play();
}

But this has no effect. The animation is still complete random (tested with loop, without loop, prewarm, etc). Its like the seed value gets ignored completely, using 5.3.0f4.
And even if the seed would be used, since its a endless range, this wouldn´t mean that it repeats seamlessley, or did this work in older versions?

using UnityEngine;
using System.Collections;

[ExecuteInEditMode]
[RequireComponent(typeof(ParticleSystem))]
public class ParticleSeamlessLoopScript : MonoBehaviour {

    public ParticleSystem ps;

    void LateUpdate () {
        ps = GetComponent<ParticleSystem>();
        ps.randomSeed = 1;
        if (ps.time >= ps.duration)
        {
            ps.Stop();
            ps.Play();
        }
    }
}

Works in the editor, but only when not in play mode! The seed is still somewhat respected in play mode, but you need to spawn a new particle system each “loop”.

Hi @karl_jones , could you confirm this is working / not working in the latest U revisions? I’ve tried (to no avail):

  • turning off auto random seed
  • resimulating/clearin/stoping&playing when simulation time reaches its end.

Tested on using U 5.4.3.

Do you have an example project?

Hi Karl,
my project is too big, will make an extract, meanwhile will check on the latest version. The effect I am aiming at is ground particle fog that just stays there.
Thank you!
Best

Hi Karl,
link to a package containing PS to be looped: https://drive.google.com/open?id=0BzfzehwYCNMMVzJqQzFRWXNaWXM

Best!