Shader error

Hi everybody

In course (2D Top Down Pixel Combat) After applying the shaders of the “Bloom” section unity reports the following error.

NullReferenceException: Object reference not set to an instance of an object
UnityEditor.ShaderGraph.Drawing.MaterialGraphEditWindow.OnDisable () (at ./Library/PackageCache/com.unity.shadergraph@14.0.4/Editor/Drawing/MaterialGraphEditWindow.cs:417)

I tried to ignore it and continue with “Finishing Touches”, but after applying the particle effects on the stage it became impossible to run the game, as multiple errors were being reported.

Is there some kind of solution?

Thanks for your time

1 Like

Seems as if your error is related to the shader graph, some things you could do to resolve the issue are:

Try restarting unity, sometimes unity acts weird, so it doesn’t hurt to try

Try removing the bloom effect, of the errors go away, then the issue could lie within the bloom effect

Double-check the Shader Graph material that you’re using for the Bloom effect. Make sure that all the required inputs are set correctly and that there are no errors or warnings in the Shader Graph editor.

Double check to see if the latest version of the shader graph package is installed

Id also try to disable certain things to see if you can find the exact problem to narrow it down.

2 Likes

I will try as directed.
I also tried reinstalling unity and it didn’t work.
If I cannot solve it, I will restart the course, it will be good to review the bases for myself.
Thanks, I’ll let you know if it worked.

1 Like

Hi Francisco,

Did you find a solution to this as its popped up a few times and seems to be an internal error with unity so i wonder if its that specific version of unity causing the issue.
They may (or may have already) release a patch to solve this issue and if not its worth reporting it to unity as a bug.
Another students solution was to avoid using the graph (It may have been yourself on udemy) and continue the course without this functionality which is certainly not ideal!

Please do let me know on how you have got on with this

1 Like

Hi Marc

Unity kept showing the error even when creating a new project, so I had to reinstall unity version.
And I will restart the course from the beginning.

Thanks for your interest

1 Like

This appears to be a version specific bug. Is your Unity between 2022.2.2 and 2.8? It appears to be resolved in 2022.2.9, and I’m not encountering it at all in my version (which off hand I can’t remember because I’m at work right now, I think 2022.2.16?

Thread on this in the Unity Forums

1 Like

Hi Brian

Update to the latest version of unity 2022.2.19 and the problem is fixed.
A different problem appeared, if I can’t solve it I will open a new thread with it.
Thanks for the help to solve this problem.

2 Likes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms