- Home /
How to turn off Exception warnings.
I know how to turn off yellow warnings :
#pragma warning disable (CS number here)
But how do I get around to ignoring warnings like MissingComponentException, NullReferenceException, etc. The ones without the number.
$$anonymous$$ost exceptions are bugs and need to be fixed. If yours are not, please show an example or screen dump.
Answer by tanoshimi · May 17, 2017 at 08:32 PM
You can ignore warnings. You can't ignore errors.
Why would you even want to? Those error messages have been placed there intentionally to indicate pretty fundamental flaws in your script. The solution is not to try to suppress them, but deal with the problem that they identify: https://docs.unity3d.com/Manual/NullReferenceException.html
I actually already finished this just a second ago. I meant the yellow warnings without CS numbers. It was for a pick up script and one of the items didn't have a special attachment the other ones had. It was trying to call that object, but I just created an empty with that name.
Your answer

Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Flip over an object (smooth transition) 3 Answers
#Warning with variables 1 Answer
Javascript: Disable warnings 1 Answer