Search Unity

Bug Editor Crashes when pressing run

Discussion in 'Editor & General Support' started by elforama, Dec 4, 2022.

  1. elforama

    elforama

    Joined:
    May 21, 2012
    Posts:
    34
    I'm running Editor version 2021.3.15f1, Apple Silicon version

    When I press the play button the editor instantly crashes.

    I was able to run the game in the editor moments earlier. I then decided to make a small script update. After that script change the editor started crashing. I reverted the script change (just a single line), but the crash still happens when pressing play. I then updated from version 2021.3.10f1 to version 2021.3.15f1 in hopes it would fix the crash, but it did not.

    Any insights into how to fix this?

    Thanks
     
  2. elforama

    elforama

    Joined:
    May 21, 2012
    Posts:
    34
    FIXED

    There was one script I forgot to revert. I had a ScriptableObject that had get/set methods on a variable. The get/set methods crashed the editor.

    Although I was able to resolve this for myself. I feel like the editor should be able to handle this and show a script error to the user instead of crashing.
     
  3. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,742
    When you understand the Halting Problem you'll understand why what you ask is not possible.

    https://en.wikipedia.org/wiki/Halting_problem

    The subject comes up here constantly but it doesn't change the problem.

    Unity is single threaded from your scripting standpoint.

    Unity will lock up 100% of the time EVERY millisecond your scripting code is running.

    Nothing will render, no input will be processed, no Debug.Log() will come out, no GameObjects or transforms will appear to update.

    Absolutely NOTHING will happen... until your code either:

    - returns from whatever function it is running

    - yields from whatever coroutine it is running

    As long as your code is looping, Unity isn't going to do even a single frame of change. Nothing.

    No exceptions.

    "Yield early, yield often, yield like your game depends on it... it does!" - Kurt Dekker