Rendering a particle system using Unity 5.5's Canvas UI

I’m following the course in Unity 5.5. I ran into some issues getting a starfield to render properly in Unity 5.5 and thought I’d share my solution in case anyone else is having trouble. Props to Mr. Hanssen over on the official Unity forums for most of the solution. In the end I had to tweak his solution a little to get it working, details below.

Create 3 cameras with the following hierarchy:

Set the GUI cameras to “Clear flags = Depth only”. Make sure the Main Camera is “Clear Flags = Skybox”.

Set the depth of the cameras in the inspector as follows:
Main Camera: Depth = 0
Gui Camera: Depth = 1
Gui Particle Camera: Depth = 2

Create a layer called “Particles” for the GuiParticles in “Edit - Project Settings - Tags and Layers”. Note you are creating a Layer not a Sorting Layer.

Assign your particle effect to this layer.

Change your menu Canvas Render Mode to “Screen space - Camera” and drag your GuiCamera to the “Render Camera” field.

Change the layer of your menu Canvas to “UI”. Make sure all the menu elements are also tagged as UI.

Finally, set the Culling Mask for each camera as follows:
Main Camera: Everything except for “UI” and “Particles”
GuiCamera: Only “UI”
GuiParticleCamera: Only “Particles”

You now have 3 render layers with each their own camera. All stuff marked as layer “Particles” will now be rendered in front of the “UI” layer.

Hope this helps.

Privacy & Terms