Search Unity

Unity crashes every time I save in VS2019

Discussion in 'Scripting' started by henleybailey, Dec 14, 2019.

  1. henleybailey

    henleybailey

    Joined:
    Dec 14, 2019
    Posts:
    3
    Hi, I'm finding that Unity crashes 100% of the time when I save in VS2019. This happens when the game is running within Unity. If I stop the game in Unity, switch to VS2019 and save, then go back and hit play again - all is fine. Something to do with the live recompile seems to crash Unity.

    I've only just started with Unity and the project is extremely basic, what could the issue be or how can I figure out what's going on? Does Unity spit out error logs anywhere?
     
    Last edited: Dec 16, 2019
  2. henleybailey

    henleybailey

    Joined:
    Dec 14, 2019
    Posts:
    3
    For anyone else having this issue, I submitted a bug and the Unity guys mentioned it looks to be something with the Oculus hand controller (I have the Oculus VR integration plugin), so is something that Oculus will probably need to tweak. Hopefully it will magically fix itself after an update of two. I'm running version 2019.3
     
  3. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    7,239
    I know from the past, Unity don't like saving scripts when at runtime. But in my case, it was typical returning errors in console. However, since then I don't save scripts when at runtime.

    If I have to, I modify scripts, then stop runtime and save then. Sure not ideal, but at least no worrying about errors, or crashes at runtime.
     
  4. henleybailey

    henleybailey

    Joined:
    Dec 14, 2019
    Posts:
    3
    That's what I've ended up doing, having to remember to stop before making any code changes. Catches me out a lot but at least it's workable. Makes workflow slower though but it's not the end of the world.
     
  5. Brathnann

    Brathnann

    Joined:
    Aug 12, 2014
    Posts:
    5,066
    Have you tried changing the Script changes while playing to "Stop playing and recompile" or "Recompile after finished playing"?
     

    Attached Files:

    Antypodish and Joe-Censored like this.
  6. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    7,239
    Oh that looks very useful. I am learning something new :)
     
unityunity