- Home /
Error with GUI.ObjectFeild()
Whenever I try to assign something to my object field it gives me this error.
NullReferenceException: Object reference not set to an instance of an object UnityEditor.EditorGUI.ValidateObjectFieldAssignment (UnityEngine.Object[] references, System.Type objType, UnityEditor.SerializedProperty property) (at C:/BuildAgent/work/d3d49558e4d408f4/artifacts/EditorGenerated/EditorGUI.cs:2454) UnityEditor.EditorGUI.DoObjectField (Rect position, Rect dropRect, Int32 id, UnityEngine.Object obj, System.Type objType, UnityEditor.SerializedProperty property, UnityEditor.ObjectFieldValidator validator, Boolean allowSceneObjects, UnityEngine.GUIStyle style) (at C:/BuildAgent/work/d3d49558e4d408f4/Editor/Mono/GUI/ObjectField.cs:44) UnityEditor.EditorGUI.DoObjectField (Rect position, Rect dropRect, Int32 id, UnityEngine.Object obj, System.Type objType, UnityEditor.SerializedProperty property, UnityEditor.ObjectFieldValidator validator, Boolean allowSceneObjects) (at C:/BuildAgent/work/d3d49558e4d408f4/Editor/Mono/GUI/ObjectField.cs:12) UnityEditor.EditorGUI.ObjectField (Rect position, UnityEngine.Object obj, System.Type objType, Boolean allowSceneObjects) (at C:/BuildAgent/work/d3d49558e4d408f4/artifacts/EditorGenerated/EditorGUI.cs:2380) CourseBlockEdit.OnInspectorGUI () (at Assets/Editor/CourseBlockEdit.cs:20) UnityEditor.InspectorWindow.DrawEditors (Boolean isRepaintEvent, UnityEditor.Editor[] editors, Boolean eyeDropperDirty) (at C:/BuildAgent/work/d3d49558e4d408f4/Editor/Mono/Inspector/InspectorWindow.cs:850) UnityEditor.DockArea:OnGUI()