Instantiated Particle System not random
So i've been using Unity long enough to know how to script my way out of the issue by running before the system plays:
ParticleSystem[] systems = gameObject.GetComponentsInChildren<ParticleSystem>();
foreach(ParticleSystem sys in systems) sys.randomSeed = (uint)Random.Range(0, int.MaxValue);
BUT this shouldn't be necessary, as Particle Systems should pick a random seed upon being instantiated, right? Setting the PSys prefab to "Play on Awake" makes it simulate exactly the same way over and over, seeming extremely repetitive.
In the editor the system generates different outcomes at every simulation, as intended.
Is this a bug? Or do i really need to iterate through every particle system, including children, to get a new simulation for each instantiated system?
Example: http://f.thorbrigsted.com/tCadb.mp4
Workaround still didnt change the patter, will have to wait for 5.4.1 for the fix.
Answer by Jose_KokonutDeveloper · Jan 19, 2017 at 10:38 PM
On 5.4.0f3 you can set your particle's random seed through code. What I did was:
void Awake()
{
particle.randomSeed = (uint)Random.range(0, 1000);
}
Answer by the_othernet · Jul 16, 2016 at 09:43 AM
I'm also seeing this behavior. Did you ever uncover any more information about it?
Answer by samizzo · Aug 05, 2016 at 06:45 AM
This is a bug. It's been reported here: https://issuetracker.unity3d.com/issues/two-independent-particle-systems-appear-to-be-using-the-exact-same-seed-for-randomisation and here http://forum.unity3d.com/threads/two-separate-particlesystems-render-on-the-same-positions.393417/
Your answer
![](https://koobas.hobune.stream/wayback/20220612083449im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
ParticleSystem.Simulate API under world space work wrong 0 Answers
emission is not a member of UnityEngine.ParticleSystem? 0 Answers
Get ParticleSystem.SizeOverLifetime curve 0 Answers
Is there a way to detect particle collision on rigidbody trigger collider? 0 Answers
ParticleSystem.Bake() not working with specific particle 0 Answers