I was attempting to create a simple script to, upon a left mouse click, reposition a sphere on the surface of a plane to the point clicked, ignoring any obstructions between view and plane, which I attempted to achieve using raycasts and layermasks.

As you can see, I dragged the String[ ] layerNames to the edge of the container so I can edit it in the inspector. Unfortunately, whenever I hit Play, the array gets reset to null. I’m also getting these error messages:
iCanScript: Internal Error: Unbalanced user transaction.
UnityEngine.Debug:Internal_Log(Int32, String, Object)
UnityEngine.Debug:LogWarning(Object)
iCS_IStorage:CloseUserTransaction(String, TransactionType)
iCS_UserCommands:CloseTransaction(iCS_IStorage, String, TransactionType)
iCS_UserCommands:ChangePortValue(iCS_EditorObject, Object)
iCS_GuiUtilities:OnInspectorDataPortGUI(iCS_EditorObject, iCS_IStorage, Int32, Dictionary2) <InspectDataProcessingNode>c__AnonStorey1B:<>m__52(iCS_EditorObject) Prelude:forEach(Action
1, List`1)
iCS_Inspector:InspectDataProcessingNode(iCS_EditorObject)
iCS_Inspector:InspectNode(iCS_EditorObject)
iCS_Inspector:OnInspectorGUI()
UnityEditor.InspectorWindow:smile:rawEditor(Editor, Int32, Boolean, Boolean&, Rect&, Boolean) (at C:\BuildAgent\work\d63dfc6385190b60\Editor\Mono\Inspector\InspectorWindow.cs:1093)
UnityEditor.InspectorWindow:smile:rawEditors(Editor[ ]) (at C:\BuildAgent\work\d63dfc6385190b60\Editor\Mono\Inspector\InspectorWindow.cs:907)
UnityEditor.InspectorWindow:OnGUI() (at C:\BuildAgent\work\d63dfc6385190b60\Editor\Mono\Inspector\InspectorWindow.cs:332)
System.Reflection.MonoMethod:InternalInvoke(Object, Object[ ], Exception&)
System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[ ], CultureInfo) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
System.Reflection.MethodBase:Invoke(Object, Object[ ]) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
UnityEditor.HostView:Invoke(String, Object) (at C:\BuildAgent\work\d63dfc6385190b60\Editor\Mono\GUI\DockArea.cs:244)
UnityEditor.HostView:Invoke(String) (at C:\BuildAgent\work\d63dfc6385190b60\Editor\Mono\GUI\DockArea.cs:237)
UnityEditor.DockArea:OnGUI() (at C:\BuildAgent\work\d63dfc6385190b60\Editor\Mono\GUI\DockArea.cs:674)
(Filename: C:/BuildAgent/work/d63dfc6385190b60/Editor/Mono/Inspector/InspectorWindow.cs Line: 1093)
ArgumentException: Getting control 13’s position in a group with only 13 controls when doing Repaint
Aborting at UnityEngine.GUILayoutGroup.GetNext () [0x00038] in C:\BuildAgent\work\d63dfc6385190b60\artifacts\EditorGenerated\GUILayoutUtility.cs:513
at UnityEngine.GUILayoutUtility.DoGetRect (Single minWidth, Single maxWidth, Single minHeight, Single maxHeight, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[ ] options) [0x00047] in C:\BuildAgent\work\d63dfc6385190b60\artifacts\EditorGenerated\GUILayoutUtility.cs:306
at UnityEngine.GUILayoutUtility.GetRect (Single minWidth, Single maxWidth, Single minHeight, Single maxHeight, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[ ] options) [0x00000] in C:\BuildAgent\work\d63dfc6385190b60\artifacts\EditorGenerated\GUILayoutUtility.cs:297
at UnityEditor.EditorGUILayout.GetControlRect (Boolean hasLabel, Single height, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[ ] options) [0x00000] in C:\BuildAgent\work\d63dfc6385190b60\Editor\Mono\EditorGUI.cs:6084
at UnityEditor.EditorGUILayout.TextField (System.String label, System.String text, UnityEngine.GUILayoutOption[ ] options) [0x00000] in C:\BuildAgent\work\d63dfc6385190b60\Editor\Mono\EditorGUI.cs:4863
at iCS_GuiUtilities.m__4C (System.String n, System.String v) [0x00000] in :0
at iCS_GuiUtilities.ModalEdit[String] (System.String niceName, System.String name, System.String& currentValue, System.String parentName, System.Func3 editor, System.Collections.Generic.Dictionary
2 db, Boolean noDelay) [0x00000] in :0
at iCS_GuiUtilities.ShowInInspector (System.String name, Boolean isReadOnly, Boolean hasSource, System.String compositeParent, System.Type baseType, System.Object currentValue, Int32 indentLevel, System.Collections.Generic.Dictionary`2 foldoutDB, System.Boolean& isDirty, .iCS_IStorage iStorage) [0x00000] in :0
at iCS_GuiUtilities.ShowInInspector (System.String name, Boolean isReadOnly, Boolean hasSource, System.String compositeParent, System.Type baseType, System.Object currentValue, Int32 indentLevel, System.Collections.Generic.Dictionary`2 foldoutDB, System.Boolean& isDirty, .iCS_IStorage iStorage) [0x00000] in :0
at iCS_GuiUtilities.OnInspectorDataPortGUI (.iCS_EditorObject port, .iCS_IStorage iStorage, Int32 indentLevel, System.Collections.Generic.Dictionary`2 foldoutDB) [0x00000] in :0
at iCS_Inspector+c__AnonStorey1B.<>m__52 (.iCS_EditorObject port) [0x00000] in :0
at Prelude.forEach[iCS_EditorObject] (System.Action1 action, System.Collections.Generic.List
1 lst) [0x00000] in :0
at iCS_Inspector.InspectDataProcessingNode (.iCS_EditorObject node) [0x00000] in :0
at iCS_Inspector.InspectNode (.iCS_EditorObject node) [0x00000] in :0
at iCS_Inspector.OnInspectorGUI () [0x00000] in :0
at UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor editor, Int32 editorIndex, Boolean forceDirty, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect, Boolean eyeDropperDirty) [0x00355] in C:\BuildAgent\work\d63dfc6385190b60\Editor\Mono\Inspector\InspectorWindow.cs:1093
UnityEngine.Debug:Internal_LogException(Exception, Object)
UnityEngine.Debug:LogException(Exception)
UnityEditor.InspectorWindow:smile:rawEditor(Editor, Int32, Boolean, Boolean&, Rect&, Boolean) (at C:\BuildAgent\work\d63dfc6385190b60\Editor\Mono\Inspector\InspectorWindow.cs:1103)
UnityEditor.InspectorWindow:smile:rawEditors(Editor[ ]) (at C:\BuildAgent\work\d63dfc6385190b60\Editor\Mono\Inspector\InspectorWindow.cs:907)
UnityEditor.InspectorWindow:OnGUI() (at C:\BuildAgent\work\d63dfc6385190b60\Editor\Mono\Inspector\InspectorWindow.cs:332)
System.Reflection.MonoMethod:InternalInvoke(Object, Object[ ], Exception&)
System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[ ], CultureInfo) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
System.Reflection.MethodBase:Invoke(Object, Object[ ]) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
UnityEditor.HostView:Invoke(String, Object) (at C:\BuildAgent\work\d63dfc6385190b60\Editor\Mono\GUI\DockArea.cs:244)
UnityEditor.HostView:Invoke(String) (at C:\BuildAgent\work\d63dfc6385190b60\Editor\Mono\GUI\DockArea.cs:237)
UnityEditor.DockArea:OnGUI() (at C:\BuildAgent\work\d63dfc6385190b60\Editor\Mono\GUI\DockArea.cs:674)
(Filename: C:/BuildAgent/work/d63dfc6385190b60/artifacts/EditorGenerated/GUILayoutUtility.cs Line: 513)