Creating a nebula

Is there a way to create a "nebula" using the particle system? I want to be able to fly into a nebula and back out of it.

If there is, can anyone point me in the right direction in making one...thanks in advance.

You can do this without any code at all:

  • Create a default particle system from the menu in Unity's UI
  • Delete just the "Particle Animator" component
  • Check the "One Shot" option in the emitter settings

Now you have a static set of particles. The min & max emission controls how many particles there are (you should probably set them both to the same value, unless you want a random value somewhere between the two). The default particle textures are already fairly suitable as they are have a fuzzy glow look. Try these values for a nebula-like effect:

  • Min size: 0.1
  • Max size: 0.7
  • Min & Max emission : 200

Of course you might want to use some custom particle textures, colour variations, and adjust the size to fit your game.

Duck's suggestion is excellent but you might leave in the particle animator on your nebula game object so that you can set the color of the particles. If you delete the animator your nebula will be white as there is no other exposed property for setting the color of the material. Or you could set a different material in the particle renderer, one that has you color baked in.

I have started a Blog for Unity and the first post is on how to create a nebula. Take a look if you are still interested. http://mikedaustin.blogspot.com/

@SpiritWebb
This can be done with particles but it doesn’t look that great and looks especially bad in VR.
I have a much more advanced system that uses 3D GPU noise shaders on an inverse sphere. I also made it so that you can move around and explore virtually infinite nebulae of all colors. Best of all it’s available on the asset store!

https://forum.unity3d.com/threads/released-procedural-nebula.467260/
![Procedural Nebula] (https://forum.unity3d.com/attachments/procedural-nebula-large-png.230425/)