Particle System, change the velocity by script

How could I change the “Velocity over Lifetime” setting of a Partycle System using a C# script?

5179-immagine.png

Thank you guys!

You need to set the particles, too. In case you want to change the velocity according to lifetime, try something like this:

void LateUpdate () {
		
		ParticleSystem.Particle[] p = new ParticleSystem.Particle[particleSystem.particleCount+1];
		int l = particleSystem.GetParticles(p);
		
        int i = 0;
        while (i < l) {
		    p<em>.velocity = new Vector3(0, p<em>.lifetime / p_.startLifetime * 10F, 0);_</em></em>

* i++;*
}

* particleSystem.SetParticles(p, l); *

* }*