Particles not showing outline or mesh wire frame in editor

Had this problem for a while.

If I add a brand new ParticleSystem into my project, and then select it in the Hierarchy and play it, then if you have ‘Selected Outline’ and ‘Selected Wire’ in the Gizmos drop down, then you get an orange outline around each particle and you can see the mesh wire and sizes.

Now, for some particles I have in my project this does not happen, and I can’t see the orange outline or the mesh. So I just can’t see how big the particles are. (Not so easy for transparent particles)

After a long time at looking into this, I have found the reason.

In the raw Scene save file (ie the scenes .unity file in explorer, the YAML), there is a section for each ParticleSystem called ‘ParticleSystemRenderer’ and under that section there is a setting called ‘m_SelectedEditorRenderState’

On the particles that display correctly, this is set to 3, on the ones that don’t display the outline, it’s set to 0.

So my questions:

  1. Why are some set differently, and how can I change this ‘flag’ in a more ‘safe’ way within the editor and not have to edit the scene file directly.
  2. Is this purely for the outline or is there any other side effects I might get by setting this to 3 on particles.

I really don’t want to go through all my particles by hand and do this, but I can’t seem to understand why it is like this, and why there doesn’t seem to be a correct way to set the flag.

Any help would be appreciated.

Hi @Robdon ,

It is a property to let the Editor know how it should render the object in the scene view and it has 3 values, Hidden,Wireframe and Highlight.

You can use this API to change this value:

Thanks @chechoggomez ,

Strangely, that enum only has values 0,1 & 2, but the editor it setting it to 3 most of the time.

I thought I had found the bug, and it was to do with prefabs and particle systems that was setting it to zero, sometimes… but I can’t get it to do it again at the moment. Will try again in a while, and if I manage, I’ll send in a bug report.

@Robdon The serialized value represents the different combinations you can get with them:

0 : EditorSelectedRenderState.Hidden
1 : EditorSelectedRenderState.Wireframe
2 : EditorSelectedRenderState.Highlight
3 : EditorSelectedRenderState.Wireframe | EditorSelectedRenderState.Highlight

So the last value is to have “highlight” and “wireframe” states active which you can set this way:
EditorUtility.SetSelectedRenderState(particleSystemRenderer, EditorSelectedRenderState.Wireframe | EditorSelectedRenderState.Highlight);

1 Like

Ah right, of course :wink: … thanks.