Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
4
Question by LeleUnity · Mar 10, 2019 at 03:35 PM · gameobjecteditorbuildnullreferenceexceptioncache

NullReferenceException on GameObjectInspector Editor Error

NOTE: NOPE, THIS IS NOT A DUPLICATE OF OTHER NULLREFERENCE EXCEPTION ANSWERS. I KNOW WHAT IS A NULLREFERENCEEXCEPTION AND YES I SEARCHED ALREADY IN THE FORUM AND NONE HAS THIS PROBLEM, SINCE THIS IS AN ERROR FROM UNITY EDITOR.


Hello, why do I get this? I tried to look for GameObjectInspector in th project, I can't find it ! Where is such PATH? and where this esact script? Nothing found on my hard drive.

  NullReferenceException: Object reference not set to an instance of an object
  UnityEditor.GameObjectInspector.ClearPreviewCache () (at C:/buildslave/unity/build/Editor/Mono/Inspector/GameObjectInspector.cs:201)
  UnityEditor.GameObjectInspector.OnDisable () (at C:/buildslave/unity/build/Editor/Mono/Inspector/GameObjectInspector.cs:189)
  UnityEditor.AssetDatabase:DeleteAsset()
  ES2EditorStartup:Cleanup()
  ES2EditorStartup:.cctor()
  UnityEditor.EditorAssemblies:ProcessInitializeOnLoadAttributes()

Comment
Add comment · Show 4
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image kamran-bigdely · Mar 10, 2019 at 03:37 PM 0
Share

What is your Unity version?

avatar image LeleUnity kamran-bigdely · Mar 10, 2019 at 03:38 PM 0
Share

version 2018.3.8

avatar image dan_wipf · Mar 10, 2019 at 05:21 PM 0
Share

assume it’s about an customeditor script?

avatar image LeleUnity dan_wipf · Mar 10, 2019 at 07:22 PM 0
Share

maybe on iTween.

6 Replies

· Add your reply
  • Sort: 
avatar image
16

Answer by GameNot · Jul 06, 2019 at 10:39 AM

Sorry for my bad English! I have the same error, and I find that it happens when I select an object in scene hierarchy and hit play. So as I understand that happens cause unity cant clean inspector. I can't find the fix for this issue, but if you deselect your selected object in the scene inspector will automatically clear and UnityEditor.GameObjectInspector.ClearPreviewCache () will never be called and this error will not appear

Comment
Add comment · Show 7 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image moaazafzal1111 · Dec 30, 2019 at 10:21 AM 1
Share

works for me

avatar image DungDajHjep · May 06, 2020 at 03:23 AM 0
Share

nice catch !

avatar image ramtinabadi · Jun 05, 2020 at 10:00 PM 0
Share

Nice workaround. Spent 30 $$anonymous$$ trying to find a fix

avatar image lclemens · Aug 10, 2020 at 07:22 PM 1
Share

Yes, I can confirm this is the case - if you don't have an object selected before pressing play, the error will not appear. It is a known bug in the Unity Editor and will probably be fixed before 2050.

avatar image davidwhiffen · Oct 26, 2020 at 02:33 PM 0
Share

This worked for me!

Show more comments
avatar image
1

Answer by NikLaws · Mar 10, 2019 at 03:47 PM

A similar question: https://answers.unity.com/questions/1446539/nullreferenceexception-pointing-nowhere.html there is a solution proposed that you could try: "Whenever I get errors from Unity's own library code, I close my project and delete /Temp and /Library. After reopening, the problems are usually gone. It could be worth a shot."

However, according to GameObjectInspector.cs im guessing you're missing an asset? Perhaps youre referring to a prefab that doesnt exist? https://github.com/Unity-Technologies/UnityCsReference/blob/master/Editor/Mono/Inspector/GameObjectInspector.cs

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image LeleUnity · Mar 10, 2019 at 05:14 PM 0
Share

I have already found that and did that. Still getting the error. Also You sent me the link of github, but where can I find that GameObjectInspector file on my project ? so maybe I can chang it? Or I shouldn't?

avatar image
1

Answer by dan_wipf · Mar 10, 2019 at 08:53 PM

Mostelikely you reference as @NikLaws says an Object, which does not exist. => NullReference is give en from (go) part of the GameObjectInspector.cs part have a Look below, go is part of a foreach loop


foreach(var go in targets)


btw. you're not allowed to change GameObjectInspector.cs, it's readOnly and provided for studies.. and you won't find it in your Computer, it's in UnityEditor.dll compiled


 //Line 189 (+ 190) from GameObjectInspector.cs
 if (!m_IsPrefabInstanceAnyRoot || !PrefabUtility.IsOutermostPrefabInstanceRoot(go))
     m_IsPrefabInstanceOutermostRoot = false; // Conservative is false if any is false
 //Line 201 (+200) from GameObjectInspector.cs
 if (PrefabUtility.IsPrefabAssetMissing(go))
     m_IsMissing = true;
 
 /* go == foreach(GameObject go in targets) */
 


Edit


well i did no sime quick research, and mostlikely it the NRE comes from the prefab you use, there’s not realy an answer to it right now, more likely a bug => but the most answers and explenations you probaly get on StackOverflow

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by stakan100gramm · Dec 24, 2020 at 01:50 AM

You just need to send your GameObject to Prefabs.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by reload666 · Mar 22, 2021 at 11:25 AM

sorry my english, knowing that the topic is old, but maybe it helps, I had this problem and it was in the action of my character when he made an attack and returned to walk or run he presented the error, solution I will adjust the animator, selecting "Has Exit Time"

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
  • 1
  • 2
  • ›

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

196 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Distribute terrain in zones 3 Answers

Objects that appear in the editor's game view do not appear in the game build 0 Answers

Scene changes not being reflected in standalone build 2 Answers

Rule Tile "GameObject" duplicating in build version 3 Answers

WebGL Build Fails il2cpp.exe Linux 3 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges