Search Unity

Strange crash in standalone build

Discussion in 'Scripting' started by manpower13, Nov 19, 2015.

  1. manpower13

    manpower13

    Joined:
    Dec 22, 2013
    Posts:
    140
    Hello everyone,

    I am stuck in a strange crash. I have a game with a mainmenu where you can click on a button to start playing. When you press that button it creates a save file for that map and loads a new scene. The new scene is loaded async, if that matters.

    This works great in the editor and does not throw any warnings or errors. In the standalone build it crashes completely.

    If I press that button in the standalone build the game freezes and Windows says the program does not react. I tried creating a development build, no errors in the screen before the game crashes. I tried linking the visual studio debugger and it gave a vague error:

    Code (CSharp):
    1. Unhandled exception at 0x77AE2312 (ntdll.dll) in SchoolSimulator_009.exe: 0xC0000005: Access violation writing location 0x0000009C.
    In the output_log.txt file it gives me this:

    Code (CSharp):
    1. Unloading 3 Unused Serialized files (Serialized files now loaded: 0)
    2. Crash!!!
    3. SymInit: Symbol-SearchPath: '.;D:\Users\fw\Desktop\SchoolSimulator Builds;D:\Users\fw\Desktop\SchoolSimulator Builds;C:\Windows;C:\Windows\system32;SRV*C:\websymbols*http://msdl.microsoft.com/download/symbols;', symOptions: 530, UserName: 'fw'
    4. OS-Version: 6.1.7601 (Service Pack 1) 0x100-0x1
    5. D:\Users\fw\Desktop\SchoolSimulator Builds\SchoolSimulator_009.exe:SchoolSimulator_009.exe (013D0000), size: 20697088 (result: 0), SymType: 'PDB', PDB: '.\player_win_development_x86.pdb', fileVersion: 5.2.2.22320
    6. C:\Windows\SysWOW64\ntdll.dll:ntdll.dll (77AC0000), size: 1572864 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\SysWOW64\ntdll.dll', fileVersion: 6.1.7601.19045
    7. C:\Windows\syswow64\kernel32.dll:kernel32.dll (773B0000), size: 1114112 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\syswow64\kernel32.dll', fileVersion: 6.1.7601.19045
    8. C:\Windows\syswow64\KERNELBASE.dll:KERNELBASE.dll (75E00000), size: 290816 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\syswow64\KERNELBASE.dll', fileVersion: 6.1.7601.19045
    9. C:\Windows\system32\HID.DLL:HID.DLL (72A50000), size: 36864 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\HID.DLL', fileVersion: 6.1.7600.16385
    10. C:\Windows\syswow64\msvcrt.dll:msvcrt.dll (75D50000), size: 704512 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\syswow64\msvcrt.dll', fileVersion: 7.0.7601.17744
    11. C:\Windows\syswow64\WS2_32.dll:WS2_32.dll (76320000), size: 217088 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\syswow64\WS2_32.dll', fileVersion: 6.1.7601.17514
    12. C:\Windows\syswow64\RPCRT4.dll:RPCRT4.dll (757F0000), size: 983040 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\syswow64\RPCRT4.dll', fileVersion: 6.1.7601.19045
    13. C:\Windows\syswow64\SspiCli.dll:SspiCli.dll (75420000), size: 393216 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\syswow64\SspiCli.dll', fileVersion: 6.1.7601.19045
    14. C:\Windows\syswow64\CRYPTBASE.dll:CRYPTBASE.dll (75410000), size: 49152 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\syswow64\CRYPTBASE.dll', fileVersion: 6.1.7601.19045
    15. C:\Windows\SysWOW64\sechost.dll:sechost.dll (76280000), size: 102400 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\SysWOW64\sechost.dll', fileVersion: 6.1.7601.18869
    16. C:\Windows\syswow64\NSI.dll:NSI.dll (77A90000), size: 24576 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\syswow64\NSI.dll', fileVersion: 6.1.7600.16385
    17. C:\Windows\syswow64\USER32.dll:USER32.dll (75670000), size: 1048576 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\syswow64\USER32.dll', fileVersion: 6.1.7601.17514
    18. C:\Windows\syswow64\GDI32.dll:GDI32.dll (75A20000), size: 589824 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\syswow64\GDI32.dll', fileVersion: 6.1.7601.18898
    19. C:\Windows\syswow64\LPK.dll:LPK.dll (75E50000), size: 40960 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\syswow64\LPK.dll', fileVersion: 6.1.7601.18985
    20. C:\Windows\syswow64\USP10.dll:USP10.dll (75490000), size: 643072 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\syswow64\USP10.dll', fileVersion: 1.626.7601.18454
    21. C:\Windows\syswow64\ADVAPI32.dll:ADVAPI32.dll (774C0000), size: 659456 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\syswow64\ADVAPI32.dll', fileVersion: 6.1.7601.18939
    22. C:\Windows\system32\VERSION.dll:VERSION.dll (75340000), size: 36864 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\VERSION.dll', fileVersion: 6.1.7600.16385
    23. C:\Windows\syswow64\ole32.dll:ole32.dll (77200000), size: 1425408 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\syswow64\ole32.dll', fileVersion: 6.1.7601.18915
    24. C:\Windows\syswow64\SHLWAPI.dll:SHLWAPI.dll (75780000), size: 356352 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\syswow64\SHLWAPI.dll', fileVersion: 6.1.7601.17514
    25. C:\Windows\syswow64\PSAPI.DLL:PSAPI.DLL (75480000), size: 20480 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\syswow64\PSAPI.DLL', fileVersion: 6.1.7600.16385
    26. C:\Windows\syswow64\SHELL32.dll:SHELL32.dll (76360000), size: 12890112 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\syswow64\SHELL32.dll', fileVersion: 6.1.7601.18952
    27. C:\Windows\system32\OPENGL32.dll:OPENGL32.dll (67010000), size: 819200 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\OPENGL32.dll', fileVersion: 6.1.7600.16385
    28. C:\Windows\system32\GLU32.dll:GLU32.dll (6E210000), size: 139264 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\GLU32.dll', fileVersion: 6.1.7600.16385
    29. C:\Windows\system32\DDRAW.dll:DDRAW.dll (64B50000), size: 946176 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\DDRAW.dll', fileVersion: 6.1.7600.16385
    30. C:\Windows\system32\DCIMAN32.dll:DCIMAN32.dll (72A40000), size: 24576 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\DCIMAN32.dll', fileVersion: 6.1.7601.18985
    31. C:\Windows\syswow64\SETUPAPI.dll:SETUPAPI.dll (75F50000), size: 1691648 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\syswow64\SETUPAPI.dll', fileVersion: 6.1.7601.17514
    32. C:\Windows\syswow64\CFGMGR32.dll:CFGMGR32.dll (75640000), size: 159744 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\syswow64\CFGMGR32.dll', fileVersion: 6.1.7601.17621
    33. C:\Windows\syswow64\OLEAUT32.dll:OLEAUT32.dll (75E60000), size: 585728 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\syswow64\OLEAUT32.dll', fileVersion: 6.1.7601.18679
    34. C:\Windows\syswow64\DEVOBJ.dll:DEVOBJ.dll (77360000), size: 73728 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\syswow64\DEVOBJ.dll', fileVersion: 6.1.7601.17621
    35. C:\Windows\system32\dwmapi.dll:dwmapi.dll (710E0000), size: 77824 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\dwmapi.dll', fileVersion: 6.1.7601.18917
    36. C:\Windows\system32\WINMM.dll:WINMM.dll (714E0000), size: 204800 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\WINMM.dll', fileVersion: 6.1.7601.17514
    37. C:\Windows\system32\MSACM32.dll:MSACM32.dll (521A0000), size: 81920 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\MSACM32.dll', fileVersion: 6.1.7600.16385
    38. C:\Windows\syswow64\IMM32.dll:IMM32.dll (75EF0000), size: 393216 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\syswow64\IMM32.dll', fileVersion: 6.1.7601.17514
    39. C:\Windows\syswow64\MSCTF.dll:MSCTF.dll (758E0000), size: 835584 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\syswow64\MSCTF.dll', fileVersion: 6.1.7601.18731
    40. C:\Windows\system32\DNSAPI.dll:DNSAPI.dll (70BE0000), size: 278528 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\DNSAPI.dll', fileVersion: 6.1.7601.17570
    41. C:\Windows\system32\IPHLPAPI.DLL:IPHLPAPI.DLL (70C90000), size: 114688 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\IPHLPAPI.DLL', fileVersion: 6.1.7601.17514
    42. C:\Windows\system32\WINNSI.DLL:WINNSI.DLL (70C80000), size: 28672 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\WINNSI.DLL', fileVersion: 6.1.7600.16385
    43. C:\Windows\system32\WINHTTP.dll:WINHTTP.dll (71340000), size: 360448 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\WINHTTP.dll', fileVersion: 6.1.7601.17514
    44. C:\Windows\system32\webio.dll:webio.dll (712F0000), size: 323584 (result: 0), SymType: '-nosymbols-', PDB: 'C:\Windows\system32\webio.dll', fileVersion: 6.1.7601.17725
    45. D:\Users\fw\Desktop\SchoolSimulator Builds\SchoolSimulator_009_Data\Mono\mono.dll:mono.dll (10000000), size: 2293760 (result: 0), SymType: '-exported-', PDB: 'D:\Users\fw\Desktop\SchoolSimulator Builds\SchoolSimulator_009_Data\Mono\mono.dll', fileVersion: 1.0.0.1
    46. C:\Windows\system32\MSWSOCK.dll:MSWSOCK.dll (70CE0000), size: 245760 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\MSWSOCK.dll', fileVersion: 6.1.7601.18254
    47. C:\Windows\System32\wshtcpip.dll:wshtcpip.dll (708A0000), size: 20480 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\wshtcpip.dll', fileVersion: 6.1.7600.16385
    48. C:\Windows\system32\dhcpcsvc6.DLL:dhcpcsvc6.DLL (70C70000), size: 53248 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\dhcpcsvc6.DLL', fileVersion: 6.1.7601.17970
    49. C:\Windows\system32\dhcpcsvc.DLL:dhcpcsvc.DLL (70C50000), size: 73728 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\dhcpcsvc.DLL', fileVersion: 6.1.7600.16385
    50. C:\Windows\system32\NLAapi.dll:NLAapi.dll (6D100000), size: 65536 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\NLAapi.dll', fileVersion: 6.1.7601.18685
    51. C:\Windows\system32\napinsp.dll:napinsp.dll (66F00000), size: 65536 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\napinsp.dll', fileVersion: 6.1.7600.16385
    52. C:\Windows\system32\pnrpnsp.dll:pnrpnsp.dll (64590000), size: 73728 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\pnrpnsp.dll', fileVersion: 6.1.7600.16385
    53. C:\Windows\System32\winrnr.dll:winrnr.dll (65F30000), size: 32768 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\winrnr.dll', fileVersion: 6.1.7600.16385
    54. C:\Windows\system32\uxtheme.dll:uxtheme.dll (71100000), size: 524288 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\uxtheme.dll', fileVersion: 6.1.7600.16385
    55. C:\Windows\system32\d3d11.dll:d3d11.dll (52020000), size: 1527808 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\d3d11.dll', fileVersion: 6.2.9200.16570
    56. C:\Windows\system32\dxgi.dll:dxgi.dll (51FD0000), size: 311296 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\dxgi.dll', fileVersion: 6.2.9200.16492
    57. C:\Windows\system32\DXGIDebug.dll:DXGIDebug.dll (51FB0000), size: 118784 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\DXGIDebug.dll', fileVersion: 9.30.9600.17298
    58. C:\Windows\syswow64\WINTRUST.dll:WINTRUST.dll (76110000), size: 192512 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\syswow64\WINTRUST.dll', fileVersion: 6.1.7601.18839
    59. C:\Windows\syswow64\CRYPT32.dll:CRYPT32.dll (76150000), size: 1183744 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\syswow64\CRYPT32.dll', fileVersion: 6.1.7601.18839
    60. C:\Windows\syswow64\MSASN1.dll:MSASN1.dll (76140000), size: 49152 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\syswow64\MSASN1.dll', fileVersion: 6.1.7601.17514
    61. C:\Windows\system32\nvwgf2um.dll:nvwgf2um.dll (51140000), size: 15093760 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\nvwgf2um.dll', fileVersion: 10.18.13.5891
    62. C:\Windows\system32\bcrypt.dll:bcrypt.dll (70740000), size: 94208 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\bcrypt.dll', fileVersion: 6.1.7600.16385
    63. C:\Windows\system32\nvspcap.dll:nvspcap.dll (087F0000), size: 1425408 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\nvspcap.dll', fileVersion: 2.5.15.54
    64. C:\Windows\system32\nvapi.dll:nvapi.dll (5BD90000), size: 3313664 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\nvapi.dll', fileVersion: 10.18.13.5891
    65. C:\Windows\syswow64\profapi.dll:profapi.dll (76100000), size: 45056 (result: 0), SymType: '-nosymbols-', PDB: 'C:\Windows\syswow64\profapi.dll', fileVersion: 6.1.7600.16385
    66. C:\Windows\system32\d3d9.dll:d3d9.dll (65D60000), size: 1847296 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\d3d9.dll', fileVersion: 6.1.7601.17514
    67. C:\Windows\system32\d3d8thk.dll:d3d8thk.dll (6E1B0000), size: 24576 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\d3d8thk.dll', fileVersion: 6.1.7600.16385
    68. C:\Windows\SysWOW64\bcryptprimitives.dll:bcryptprimitives.dll (70860000), size: 249856 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\SysWOW64\bcryptprimitives.dll', fileVersion: 6.1.7601.19012
    69. C:\Windows\system32\MMDevAPI.DLL:MMDevAPI.DLL (51100000), size: 233472 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\MMDevAPI.DLL', fileVersion: 6.1.7601.17514
    70. C:\Windows\system32\PROPSYS.dll:PROPSYS.dll (6D000000), size: 1003520 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\PROPSYS.dll', fileVersion: 7.0.7601.17514
    71. C:\Windows\system32\wdmaud.drv:wdmaud.drv (6E1E0000), size: 196608 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\wdmaud.drv', fileVersion: 6.1.7601.17514
    72. C:\Windows\system32\ksuser.dll:ksuser.dll (53560000), size: 16384 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\ksuser.dll', fileVersion: 6.1.7600.16385
    73. C:\Windows\system32\AVRT.dll:AVRT.dll (510C0000), size: 28672 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\AVRT.dll', fileVersion: 6.1.7600.16385
    74. C:\Windows\system32\AUDIOSES.DLL:AUDIOSES.DLL (51080000), size: 221184 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\AUDIOSES.DLL', fileVersion: 6.1.7601.18741
    75. C:\Windows\system32\msacm32.drv:msacm32.drv (6E1D0000), size: 32768 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\msacm32.drv', fileVersion: 6.1.7600.16385
    76. C:\Windows\system32\midimap.dll:midimap.dll (6E1C0000), size: 28672 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\midimap.dll', fileVersion: 6.1.7600.16385
    77. C:\Windows\system32\dsound.dll:dsound.dll (65CE0000), size: 466944 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\dsound.dll', fileVersion: 6.1.7600.16385
    78. C:\Windows\system32\POWRPROF.dll:POWRPROF.dll (742F0000), size: 151552 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\POWRPROF.dll', fileVersion: 6.1.7600.16385
    79. C:\Windows\syswow64\CLBCatQ.DLL:CLBCatQ.DLL (75530000), size: 536576 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\syswow64\CLBCatQ.DLL', fileVersion: 2001.12.8530.16385
    80. C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7601.18837_none_41e855142bd5705d\comctl32.dll:comctl32.dll (6FF20000), size: 1695744 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7601.18837_none_41e855142bd5705d\comctl32.dll', fileVersion: 6.10.7601.18837
    81. C:\Windows\system32\xinput1_3.dll:xinput1_3.dll (06610000), size: 90112 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\xinput1_3.dll', fileVersion: 9.18.944.0
    82. C:\Windows\system32\dbghelp.dll:dbghelp.dll (75190000), size: 962560 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\dbghelp.dll', fileVersion: 6.1.7601.17514
    83.  
    84. ========== OUTPUTING STACK TRACE ==================
    85.  

    I have no idea what to do with this.
    I don't know if this helps but the game crashes when the second scene is loaded for 90%.

    Unity version: 5.2.2f1.

    Thank you for your time :).

    Floris Weers
     
  2. gorbit99

    gorbit99

    Joined:
    Jul 14, 2015
    Posts:
    1,350
    The build can't acces the place, where it's trying to create sometthing, that's what violation write position means, try running it in as administrator
     
    manpower13 likes this.
  3. manpower13

    manpower13

    Joined:
    Dec 22, 2013
    Posts:
    140
    Thank you @gorbit99

    That sounds right. I will try that today!
     
  4. manpower13

    manpower13

    Joined:
    Dec 22, 2013
    Posts:
    140
    Hi @gorbit99 again,

    I tried running the game as administrator, same crash with same messages. I have no clue why it is crashing, but thank you for your time.

    Floris Weers
     
  5. gorbit99

    gorbit99

    Joined:
    Jul 14, 2015
    Posts:
    1,350
    Can you post the code, that tries to write a file?
     
  6. manpower13

    manpower13

    Joined:
    Dec 22, 2013
    Posts:
    140
    Hello @gorbit99

    Of course! This is the code that creates the new file:

    Code (CSharp):
    1.     public void NewMap(string Name)
    2.     {
    3.         DirectoryInfo Info = Directory.CreateDirectory(Path.GetDirectoryName(SaveLoad.DirectoryPath));
    4.         Info.Refresh();
    5.         int fCount = Info.GetFiles().Length / 2;
    6.         SaveLoad.CurrentSave = fCount;
    7.         SaveLoad.CreateNewFile(fCount);  //A function that creates the file, see below.
    8.         SaveLoad.SaveSimple("Global#MapName", Name);   //code adds a variable to the queue of things to save in the new file
    9.         SaveLoad.Save();    //Actually save the queue.
    10.         LoadMap(fCount);    //Load the new map.
    11.     }
    //The function that creates the new file:
    Code (CSharp):
    1.     public static void CreateNewFile(int number)
    2.     {
    3.         Directory.CreateDirectory(Path.GetDirectoryName(DirectoryPath));
    4.         using (FileStream fs = File.Create(FilePath))    //FilePath is a get string that creates a path string.
    5.         {
    6.             fs.Flush();
    7.             fs.Close();
    8.         }
    9.         using (StreamWriter sw = new StreamWriter(FilePath, true, Encoding.Default))
    10.         {
    11. //here I write a default line at the top of the file, it used in the loading system.
    12.             sw.WriteLine(StartLine);
    13.             sw.Flush();
    14.             sw.Close();
    15.         }
    16.     }
    The Loadmap function with the coroutine that loads the scene:
    Code (CSharp):
    1.     public void LoadMap(int number)
    2.     {
    3.         SaveLoad.CurrentSave = number;
    4.         StartCoroutine(LoadScene());
    5.     }
    6.  
    7.     IEnumerator LoadScene()
    8.     {
    9.         LoadingIcon.SetActive(true);   //Set a loading Icon active for the user. SEE COMMENT 1 BELOW
    10.         AsyncOperation async = Application.LoadLevelAsync("Game");
    11.         Text LoadText = LoadingIcon.GetComponent<Text>();
    12.         while(!async.isDone)
    13.         {
    14.             //we are loading..
    15.             LoadText.text = async.progress * 100 + "%";
    16.             yield return null;
    17.         }
    18.         LoadingIcon.SetActive(false);
    19.     }
    COMMENT 1:
    The line: LoadingIcon.SetActive(true) refers to a gameobject in the canvas that shows the loading progress. The strange thing is, the icon shows up in the editor. Not always in the actual build. That is probably another bug that is related to the depth (?).

    I don't really think my code is the problem here, it works in the editor but not in the actual build. That seems to be a unity bug to me? I am going to update my Unity this week, to eliminate that possibility. (my current Unity version is 5.2.2f1.)

    Thank you for reading! :)
     
  7. gorbit99

    gorbit99

    Joined:
    Jul 14, 2015
    Posts:
    1,350
    You should put a null checker or a try-catch there, because I think the file you're trying to edit doesn't exist
     
    manpower13 likes this.
  8. manpower13

    manpower13

    Joined:
    Dec 22, 2013
    Posts:
    140
    Hi @gorbit99

    Sorry for the long delay, and thank you for your help.
    I put a try catch in the script but it does seem to help. I checked some more things and it does not seem to be my saving system.
    The error is inside the LoadScene function. I will try to add a try catch in that method now.

    EDIT:
    So after checking some more things, I am sure it is not my fault.
    Changing the way the scene loads to non-async (just the regular Application.LoadLevel("Game")) works.
    All my code runs without errors when using the async method.

    As a temperary fix I will using the Application.LoadLevel methode instead of the LoadLevelAsync, but if anyone knows how to fix this I would like to know :).

    No errors inside the editor, a crash when building. That seems to be Unity related right?
     
    Last edited: Nov 25, 2015