Velvet Star Monitor

Standout celebrity highlights with iconic style.

news

Why is Unity crashing when I press play in the editor?

Writer Mia Lopez

My game is crashing whenever I switch scenes and then press play in the editor. I am using this code to switch scenes:

enter image description here

...

enter image description here

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.

1

2 Answers

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.

1

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.

1