Hello community, I am having problem modifing the duration of particlesystem (which I have reference to).
I’ve tried the method that is used in many examples and most importantly in the official documentation.
So this is what I’ve tried: (particleTemplate is the gameobject the particle system is attached to)
ParticleSystem ps;
ps = particleTemplate.GetComponent<ParticleSystem>();
ps.Stop(); // Cannot set duration whilst particle system is playing
var main = ps.main;
This is the error that occurs:
'UnityEngine.ParticleSystem' does not contain a definition for 'main' and no extension method 'main' accepting a first argument of type 'UnityEngine.ParticleSystem' could be found (are you missing a using directive or an assembly reference?)
Well, obviously the ParticleSystem doesnt have a variable ‘main’ or I dont have accsess to it, so are the documentation outdated?
And most importantly - how do I modify duration time of a particle system at runtime?