Object reference not set to an instance of an object UnityEngine

纵然是瞬间 提交于 2020-12-06 12:07:14

问题


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


回答1:


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.



来源:https://stackoverflow.com/questions/59056793/object-reference-not-set-to-an-instance-of-an-object-unityengine

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!