(Using Unity 2021.2 or 2021.3, HDRP)
My scene view works, the build is successful without errors. But when I run exe, the game immediately crashes (Black screen + unity crash modal).
I check the crash log (w/ copy PDB files active), and stack trace says:
This at the top:
The file 'C:/WORKSPACE/Game_HDRP (2021.2)/_BUILDS/test/Game_HDRP_Data/level0' is corrupted! Remove it and launch unity again!
[Position out of bounds!]
Crash!!!
And This at the bottom:
========== OUTPUTTING STACK TRACE ==================
0x00007FFE7CAAB6B3 (UnityPlayer) DebugStringToFilePostprocessedStacktrace
0x00007FFE7CAAAF36 (UnityPlayer) DebugStringToFile
0x00007FFE7C1B4A97 (UnityPlayer) CachedReader::OutOfBoundsError
0x00007FFE7C1B5385 (UnityPlayer) CachedReader::UpdateReadCache
0x00007FFE7C33F0CA (UnityPlayer) TransferField_NonArray<StreamedBinaryRead,Converter_String>
0x00007FFE7C32F2FA (UnityPlayer) ExecuteSerializationCommands<ConfigSettingsRead>
0x00007FFE7C34ED8C (UnityPlayer) Transfer_ManagedObject<StreamedBinaryWrite,0>
0x00007FFE7C32F3C3 (UnityPlayer) ExecuteSerializationCommands<ConfigSettingsRead>
0x00007FFE7C353E65 (UnityPlayer) <lambda_16523cd740f7547f2d52fa3c639b538e>::operator()
0x00007FFE7C3443E8 (UnityPlayer) TransferScriptingObject<StreamedBinaryRead>
0x00007FFE7C344412 (UnityPlayer) TransferScriptingObject<StreamedBinaryRead>
0x00007FFE7C360884 (UnityPlayer) SerializableManagedRefTransfer::Transfer
0x00007FFE7C3717EA (UnityPlayer) SerializedFile::ReadObject
0x00007FFE7C367A67 (UnityPlayer) PersistentManager::ReadAndActivateObjectThreaded
0x00007FFE7C365E96 (UnityPlayer) PersistentManager::LoadFileCompletelyThreaded
0x00007FFE7C1A544E (UnityPlayer) LoadSceneOperation::Perform
0x00007FFE7C1A5FA9 (UnityPlayer) PreloadManager::ProcessSingleOperation
0x00007FFE7C1A6328 (UnityPlayer) PreloadManager::Run
0x00007FFE7C1A6399 (UnityPlayer) PreloadManager::Run
0x00007FFE7C25A2A1 (UnityPlayer) Thread::RunThreadWrapper
0x00007FFF67C17034 (KERNEL32) BaseThreadInitThunk
0x00007FFF69002651 (ntdll) RtlUserThreadStart
========== END OF STACKTRACE ===========
I’ve tried many things, from editing scripts, to updating to latest, same-gen version of unity. Nothing seems to change the outcome, and this only occurs when I build a specific scene (other scenes build fine/don’t crash).
(Edit: as of updating to 2021.3.2f, game STILL crashes after build, but I also get these errors after build. There is no in-app purchasing in this specific project to speak of. I don’t know if they’re relevant, but figured I’d post them just in case.)
Edit:
I’ve also tried building to a path without spaces (i.e. a different folder, on desktop).
Tried disabling anti-virus while/before building.
Tried updating gfx drivers/OS/restarting computer/restarting unity/upgrading unity (same generation, newer version).
Edit:
I’ve narrowed it down to 3 objects in my scene containing hundreds of children holding a distinct interaction involving a C# script using graphics buffer to send info to the vfx graph.