I have a quite complicated scene, with 7 scripts attached to various objects.
When loading the scene, one of the scripts produces this error in the console:
MissingReferenceException: The object of type 'ParticleSystem' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
UnityEngine.Component.GetComponent[ParticleSystemRenderer] () (at C:/buildslave/unity/build/artifacts/generated/common/runtime/ComponentBindings.gen.cs:48)
UnityEditor.ParticleEffectUI.RefreshShowOnlySelected () (at C:/buildslave/unity/build/Editor/Mono/ParticleSystemEditor/ParticleEffectUI.cs:1016)
UnityEditor.ParticleEffectUI.SetShowOnlySelectedMode (Boolean enable) (at C:/buildslave/unity/build/Editor/Mono/ParticleSystemEditor/ParticleEffectUI.cs:997)
UnityEditor.ParticleEffectUI.Clear () (at C:/buildslave/unity/build/Editor/Mono/ParticleSystemEditor/ParticleEffectUI.cs:310)
UnityEditor.ParticleSystemInspector.OnDisable () (at C:/buildslave/unity/build/Editor/Mono/ParticleSystemEditor/ParticleSystemEditor.cs:64)
As you can see, the error is not pointing to a certain line of a certain script.
How can I find which script exactly produces it and at which line?
Check your 7 scripts and see which have access a particle system component, and try to track it down…
somewhere, you’re trying to reference it to use/do something in some manner, after it’s been destroyed…
I’m not sure if that’s one of OPs scripts. Most of those show UnityEditor, which makes me think it’s not one of OPs scripts. So it may be an editor script that is looking for a particlesystem perhaps?
Thanks, methos5k. Tried that, I added breaking points in all the scripts at all the lines dealing with particle systems. Still couldn’t catch it. It’s somewhere between 2 lines of code in an update function. It’s like: I press the ‘Step over’ button on some line that has no pSystem reference, it pauses for half a second, in which time I think it’s compiling some other script, and then it throws the error.
Do you have any plugins that use the particlesystems? Maybe one that helps you create them or modify them? Or if you have particles that you got off the store, did they come with editor scripts? (I know some do include this)
Hi, mdnpublisher
I got the same error messages when I just delete a game object with particle system from the scene, manually, while editing the scene.
Did you find any solutions?
I’m using Unity5.6.4 p3 without any 3rd party plugins.
I upgraded to 2017.1 and now the error only pops out intermitently and randomly, not every time. Once every 20 times I press the Play button in the Inspector. Which is not such a big deal for me.
I’m suspecting it’s a MonoDeveloper bug, it pops up more often when I run with MonoDeveloper attached to the Unity process. Just for info, I’m running on Windows 10.
Is there any update on this? I notice it is happening when you delete a newly created particle system in a blank project on Unity 5.6.4p4 and 5.6.5. So it must be something related to unity
They are UnityEditor errors, so they shouldn’t have any impact on your release. You shouldn’t have to worry about them unless you notice something odd.