My game is crashing whenever I switch scenes and then press play in the editor. I am using this code to switch scenes:
...
I have tried disabling most of the scripts in my game to debug the problem but it freezes every time. I've also tried loading the levels without the co-routines but that doesn't help. I can continue playing the game as long as I don't use the editor controls, however things get pretty choppy and performance becomes terrible.
Unity Crash while playing the game can occur due to various causes such as service situation, network environment, and PC specifications. If this problem frequently occurs, please check the following. 1. Please double check to see if your PC meets the minimum gaming requirements for our game.
If you want to restore your crashed scene, you have to go to your project's directory (this is the folder that contains the Assets directory) then enter the Temp directory. You will find the __EditModeScene file within. This is your saved scene file.
It sends data to the developer if they're using Unity Cloud Diagnostics. It also captures the dump file of the crash game and writes it to disk, even the game developer hasn't configured anything (so you could send it to them manually).
To view the Editor log, select Open Editor Log in Unity's Console window. On macOS, all the logs can be accessed uniformly through the standard Console. app utility. On Windows, the Editor log file is stored in the local application data folder <LOCALAPPDATA>\Unity\Editor\Editor.
First, look at the editor logs, quite possible that the reason of the crash will be there. If unsure, post them here (post on gist and link here).
Also, if you have unity pro (or a trial version of pro), try looking at the profiler's readings. On free you can also try looking at the Stats button from the Game window. Using too much memory (RAM or VRAM) can cause crashes.
i was also having same problem. if your program is correct then just change the editor path to anything in unity hub and save, close unity hub, open again and set the path to previous one.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With