2D Game - How to Create an starfield with particle systems


I’m trying to create a starry sky for a 2D game using Unity’s particle system. Is it possible to create particle emission only once? And after that only work with the alpha of emitted particles? (Blink effect)

I have something like this:


But it gets emitted all the time, is it possible to do what I’m thinking?

I would like something like this:

I appreciate any tips, even if that is not the best way to do it.

Thank you!

You set random between 2 very high constants of start lifetime about the expected duration of your scene. For the blinking effect, if you are using Unity 5.5, the looping function for curve graph is really helpful to repeat the curve. Refer to my attached image, in the Size over Lifetime curve graph, I set 5 linear points with the middle one dipped to zero. Then at the right end of the curve there is a cog and you can click it to set “loop”. Finally press “Ctrl+A” in the graph to select all visible points, there is 4 “scaling” blue lines, drag the right vertical blue line leftward and you can see the pattern of the curve is repeated. Because you have already set “random between 2 lifetime constants”, you don’t need to worry about the particles blinking in the same moment. If you are using older Unity, then you will need to repeat those points in the curve graph manually.

Lastly about performance with texture/material: Normally you would use a star/flare texture for better result, but if you are concerned with performance, you may downgrade the material to just unlit-color shader which is opaque instead of alpha. Alpha overdraw is something you want to reduce as much as possible especially for mobile game.