- Home /
Encountering "Null Reference Exception: Object reference not set to an instance of an object" in Build, but not in Editor
I am getting a Null Reference Exception in my Build on line 89 (see my code posted below). How can I fix this?
Additional Context (if needed)
I am new to Unity and to coding in C#. I made my first big project - a dice roller specialized for my table-top RPG's rules. It works in Editor, but when I build the project I get Null Reference Exceptions - and the game does not work properly.
I have looked at the log file on the build to find out which lines of code are causing these issues. There seems to be many of these Null Reference Exceptions in my code on Build, but I would just like help with one of them to start (and hopefully I can figure out the rest from there...)
When I use Debug.Log() in the editor to check which variables on those lines are turning up Null, I'm not seeing any Null values. To clarify, there are no Null Reference Exception errors in the Editor console.
Also, if anyone knows an alternative way to find out exactly what is causing the error on the .cs line (since Debug.Log isn't working), I would really appreciate a forward.
Thanks!