Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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
2
Question by JeppeNygaard · Mar 22, 2013 at 07:39 AM · nullreferenceexception

how do I find what causes "NullReferenceException"

Hi all,

I've been reading about NullReferenceException in here and I think I have a better understanding of the problem now - BUT, I can't find which script is causing the problem.

This is what I'm getting:

"NullReferenceException: Object reference not set to an instance of an object UnityEditor.DockArea.OnGUI ()"

Does any know a good way to locate which script or part of my project that causes this error?

thanks Jeppe

Comment
Add comment
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

2 Replies

· Add your reply
  • Sort: 
avatar image
3
Best Answer

Answer by JeppeNygaard · Mar 22, 2013 at 08:51 AM

Thank you for all your answers.

I followed your advice Louis and tried to reset my editor layout back to factory default and sure enough there was an editor window that Unity wasn't able to destroy :"DockArea" - I couldn't see it and I don't know what it is - but after re-setting the layout and re-starting unity - the error message disappeared! - thanks again!

Jeppe

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 sparkzbarca · Mar 22, 2013 at 07:51 AM

double click on the error.

It means it appears unityeditor doesnt exist most likely

basically your trying to call a function of an object. but the object doesnt exist.

your trying to call

gun.fire() but you dont have a gun for example

in that case your trying to call OnGUI() but it doesnt exist probaly because but DockArea doesnt exist probably because unityeditor doesnt.

Comment
Add comment · Show 5 · 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 JeppeNygaard · Mar 22, 2013 at 08:12 AM 0
Share

Thank you for your quick reply!!

When I doubleclick the error, this shows up in the inspector: alt text

I'm using a lot of scripts attached to elements bought in the AssetStore - I'm suspecting that this occurs in one of the many scripts, somehwere inside the asset-folder - a true needle/haystack issue.

is there a way to locate this script? ... is it 100% sure that this IS indeed caused by a script? ... or can it be something else?

error.jpg (12.9 kB)
avatar image whydoidoit · Mar 22, 2013 at 08:16 AM 0
Share

Does $$anonymous$$onoDevelop not open too - when you double click?

avatar image JeppeNygaard · Mar 22, 2013 at 08:33 AM 0
Share

no! ... and when I press "clear" in the console, the error appears on constant repeat again (like it's evaluating a script or an endless loop somewhere) ... any suggestions?

avatar image Loius · Mar 22, 2013 at 08:38 AM 2
Share

That particular error is internal, so it won't open a scripting window. It IS caused by a script (far as I know).

I remember fixing this once by resetting Unity's window layout (which, I'm guessing, closed whatever of my special inspectors was malfunctioning).

I think it can possibly also be caused by not closing all the closable GUI elements (BeginHorizontal, etc) in the Editor, and/or certain usage in the Scene GUI while not in play mode. It's a vague error with several possible causes :(

avatar image whydoidoit · Mar 22, 2013 at 08:43 AM 0
Share

Yeah like !IsPlayingOrAllowInExecute$$anonymous$$ode which I just can't find what's causing it.

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

13 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

Related Questions

Null reference error after detecting collision 0 Answers

Attached scripts as List? 1 Answer

NullReferenceException script problem? 0 Answers

I'm having more problems accessing a variable from another script in c# 2 Answers

NullReferenceException 1 Answer


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