x


" NullReferenceException: Object reference not set to an instance of an object"

Please help me. Do you know why I'm receiving this message meanwhile I'm testing my game?.

NullReferenceException: Object reference not set to an instance of an object UnityEditor.ListViewShared.HasMouseDown (UnityEditor.InternalListViewState ilvState, Rect r, Int32 button) (at C:/BuildAgent/work/6bc5f79e0a4296d6/Editor/Mono/GUI/ListViewShared.cs:180) UnityEditor.ListViewShared.HasMouseDown (UnityEditor.InternalListViewState ilvState, Rect r) (at C:/BuildAgent/work/6bc5f79e0a4296d6/Editor/Mono/GUI/ListViewShared.cs:175) UnityEditor.ListViewShared+ListViewElementsEnumerator.MoveNext () (at C:/BuildAgent/work/6bc5f79e0a4296d6/Editor/Mono/GUI/ListViewShared.cs:368) UnityEditor.ConsoleWindow.OnGUI () (at C:/BuildAgent/work/6bc5f79e0a4296d6/Editor/Mono/ConsoleWindow.cs:422) System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture)

Thank you very much.

more ▼

asked Oct 04 '11 at 12:35 PM

jorgon gravatar image

jorgon
77 26 34 35

You'll have to show us the code at that line- just the error message doesn't tell us any more than your question title does!

Oct 04 '11 at 12:35 PM syclamoth
(comments are locked)
10|3000 characters needed characters left

3 answers: sort oldest

This problems doesnt have to do with the project itself, but something with Unity/Visual Studio/Monodevelop.

I have the same issue, after having just started a fresh project and: 1. pressing "sync monodevelop project" since the thing still wont recognize I'm using VS 2. opening the project in the unity project folder so i can get proper references 3. building a simple script 4. fixing the incorrect "line endings" on the script to windows format

I think it has something to do with trying to reference something from monodevelop, for some reason.

more ▼

answered Oct 12 '11 at 01:06 AM

Sintua gravatar image

Sintua
16 1 2 4

(comments are locked)
10|3000 characters needed characters left

It means that an object is referenced somewhere in the code but the game cant find that gameobject since it returns null which is the indication that it does not exist , which means that you either had a GameObject or Behaviour variable and you did not get to define the object or behaviour you want it to reference in the inspector. Alternatively , GameObject.Find functions return a nullreference exception if you try to access something from a found gameobject , but the game does not actually find it. So if you dont have for example a gameobject named foo , GameObject.Find("foo").bar=3; would return a nullreferenceexception due to the fact that the variable bar does not exist in the inexistent gameobject.

You ought to provide us with the code that produces the error for more specific information though

more ▼

answered Oct 04 '11 at 02:16 PM

yeoldesnake 1 gravatar image

yeoldesnake 1
549 15 18 22

(comments are locked)
10|3000 characters needed characters left

I solved my issue a week ago. I'm a newbye and sometimes I don't know how to understand those debugging messages.

But thank you anyway. :-)

more ▼

answered Oct 12 '11 at 10:18 AM

jorgon gravatar image

jorgon
77 26 34 35

would be great if you bothered to tell others what the solution was...

Aug 21 '12 at 07:54 AM charlesvi
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

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

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1095
x396
x263
x203

asked: Oct 04 '11 at 12:35 PM

Seen: 3688 times

Last Updated: Aug 21 '12 at 07:54 AM