Sorry, for stupid question, but the result of my code was confusing me. So point is that, I want to increase the amount of particles to max value during a second (or certain amount of seconds). I thought is quite easy, but I was wrong. Here is my code:
Not familiar with the particle creation but Time.deltaTime is a fraction of a second based on frame rate per second.
If you want to increase the particles you’ll need to set the start amount of particles and increase over time to maxValue and the increase will be by time.deltaTime / Number of seconds.
I’m assuming emissionRate is a float. Like I said not done much work with particles.
Time.deltaTime is the amount of elapsed time per frame, so we would consider something like this:
if(particle.emissionRate < 1f) //Caps the emissionRate to 1
particle.emissionRate += Time.deltaTime; //Adds a frame to the emissionRate.
Now let’s add the maximum emissionRate and the number of seconds to do so… We’ll assume that maxValue is 10 and numSeconds is 2, making this increase emissionRate to 10 in two seconds.