Search Unity

Editor is Compiling after the game has started running

Discussion in 'Editor & General Support' started by gfaraj, Jul 27, 2018.

  1. gfaraj

    gfaraj

    Joined:
    Jul 11, 2016
    Posts:
    35
    Hey all,

    I've upgraded my project from 2017.4 to 2018.2 and I've noticed something strange is happening.

    When I run the game, everything works well until about 20 seconds after where I'm getting null reference errors because a static reference that I'm accessing is null (this is a singleton "Instance" kind of thing).

    I can access that reference fine for the first 20 seconds of running, but after that it seems like it gets reset to null.

    I noticed that the editor log says "Compiling..." AFTER the game has been running a few seconds. That might be causing the runtime to be clearing all static data variables.

    2017 doesn't seem to show this message during runtime for me, so I'm thinking this is the problem. How can I stop it from doing that?

    Any ideas?
     
  2. gfaraj

    gfaraj

    Joined:
    Jul 11, 2016
    Posts:
    35
    OK, I rebooted my machine and the problem appears to have completely disappeared. That is very strange, but I'll take it.

    Thanks anyways.
     
unityunity