- Home /
Why am I getting this compile error?
I have come across this compile error whilst designing a car game using EasyRoads3D:
ArgumentException: The thing you want to instantiate is null. UnityEngine.Object.CheckNullArgument (System.Object arg, System.String message) (at C:/BuildAgent/work/d3d49558e4d408f4/artifacts/EditorGenerated/UnityEngineObject.cs:104) UnityEngine.Object.Instantiate (UnityEngine.Object original) (at C:/BuildAgent/work/d3d49558e4d408f4/artifacts/EditorGenerated/UnityEngineObject.cs:90) NewEasyRoads3D.OnGUI () (at Assets/EasyRoads3D/Editor/NewEasyRoads3D.cs:97) System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222) Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation. System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232) System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115) UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/BuildAgent/work/d3d49558e4d408f4/Editor/Mono/GUI/DockArea.cs:231) UnityEditor.HostView.Invoke (System.String methodName) (at C:/BuildAgent/work/d3d49558e4d408f4/Editor/Mono/GUI/DockArea.cs:224) UnityEditor.HostView.OnGUI () (at C:/BuildAgent/work/d3d49558e4d408f4/Editor/Mono/GUI/DockArea.cs:120)
I would really appreciate any help with this, if anyone needs any more details please get back to me
Click on this error in the Console and it should take you to the offending code; a quick glance at it seems an Instantiate(something) where something is null; include the code that this error is caused from (the relevant parts)
Your answer

Follow this Question
Related Questions
How to shoot using the right mobile Joystick? 2 Answers
How to create C# or JS mouse look script 0 Answers
Enemy Script Help 0 Answers
Define in Inspector which variable will be set from which script 1 Answer