2

Keep a long story short, ive suddenly gotten a bunch of these errors in unity when coding my game (The numbers keep going up)

NullReferenceException: Object reference not set to an instance of an object
UnityEngine.UIElements.UIR.RenderChain.Render (UnityEngine.Rect topRect, UnityEngine.Matrix4x4 projection)

Its my first template of a much larger project, but none of my objects' scripts reference anything to do with UIElements... just UI for setting the text of an ammo counter You guys got any ideas? it doesnt affect my gameplay or my scripts it just is annoying in the console, and it happens when im not in game too. I think the amount of errors has maxed out at 35, in the time of writing this Thanks! :D

  • Does this answer your question? [What is a NullReferenceException, and how do I fix it?](https://stackoverflow.com/questions/4660142/what-is-a-nullreferenceexception-and-how-do-i-fix-it) – Draco18s no longer trusts SE Nov 26 '19 at 18:55
  • Hmmm not really... thing is i havnt referenced UIElements anywhere, unless its autogenerated in the Text component... it also seems to appear randomly. like now im fine but 5 minutes later it was happening, i woud still like to know what caused it so this isnt technically "resolved" even though the issue has gone down for me for now – Mackenzie Toxik Blackaby Nov 26 '19 at 20:34
  • Then there's likely not enough detail for anyone here to have any idea what's wrong. – Draco18s no longer trusts SE Nov 26 '19 at 20:40

1 Answers1

5

You can try to delete the project's caching folder "library", this will make Unity reimport all your assets and generate new copies of intermediate DLLs.
Warning: It will take a long time to reimport all assets if your project is big.

Simon
  • 647
  • 4
  • 9