Error while importing GM_Construct
Hey im trying to import gm_construct to test this tool using unity 2019 LTS. This is the error i get
NullReferenceException: Object reference not set to an instance of an object uSrcTools.SourceBSPLoader.LoadEntity (System.Int32 index) (at Assets/Code/Read/SourceBSPLoader.cs:286) uSrcTools.SourceBSPLoader.Load (System.String mapName) (at Assets/Code/Read/SourceBSPLoader.cs:144) uSrcTools.Test.Load () (at Assets/Code/Test.cs:74) uSrcTools.MapLoader.OnInspectorGUI () (at Assets/Code/Test.cs:18) UnityEditor.UIElements.InspectorElement+<>c__DisplayClass58_0.<CreateIMGUIInspectorFromEditor>b__0 () (at <a259d3c004024353a2c217da97495055>:0) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
You might have forgotten to assign a variable, post the line of code which errored
You might have forgotten to assign a variable, post the line of code which errored
https://github.com/lewa-j/Unity-Source-Tools/blob/master/Assets/Code/Read/SourceBSPLoader.cs#L286
You might have forgotten to assign a variable, post the line of code which errored
https://github.com/lewa-j/Unity-Source-Tools/blob/master/Assets/Code/Read/SourceBSPLoader.cs#L286
Oh yeah, those lines of code don't have null checks so if it can't load the file it will error. You can fix this by changing their WrapMode and assigning them https://github.com/lewa-j/Unity-Source-Tools/blob/1c5dc0635cdc4c65775d4af2c4449be49639f46b/Assets/Code/Read/SourceBSPLoader.cs#L306-L311
only when they are not null.