6

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.

LooMeenin
  • 818
  • 3
  • 17
  • 33
  • 1
    If you say that the problem occurs even without the co-routines, then the error is somewhere else. (Could it be some awake or start function in the other scene?) Continue removing things as long as you find what is causing the error. Also, it is much easier for the others to help if you copy paste your code rather than posting a picture of it. – maZZZu Dec 01 '14 at 06:31

2 Answers2

9

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.

Krzysztof Bociurko
  • 4,575
  • 2
  • 26
  • 44
3

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.

Shubham
  • 31
  • 1
  • Thank you, this worked for me! It was more annoying that my editor log showed no info of the errors/crashes, just the typical logging stuff. – Molasses Dec 11 '20 at 13:36