Search Unity

Question Window not clearing

Discussion in 'Editor & General Support' started by tclancey, Sep 30, 2020.

  1. tclancey

    tclancey

    Joined:
    May 19, 2017
    Posts:
    143
    Well this is a new one.

    While working on this project that creates thousands of data points, I'm having a problem with the screen. All the objects I'm creating are getting drawn, but the window (game window, not editor) doesn't get cleared, so any movement results in snakes.

    The code runs with a counter in the update method, each frame update it does a load of calcs and spits out an object that get's added to a list. That's it, nothing special.

    Another odd thing, when the counter has reached is total and the loops stop and all the variables are set back to 'ready' state the screen still snakes, and if I move the camera around Unity freaks out and bombs.

    Should I be creating this objects somewhere else? I've not tried co-routines, I'll maybe give that a go.

    Any advice?
    Thanks,
     
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    It is hard to comment on what you're specifically doing just from your description, but with a problem of the game window not clearing each frame I would be looking at the "Clear Flags" setting on the camera as the first thing I would check. Setting it to "Don't Clear" would produce exactly what you describe. Setting it to "Skybox" is probably the most common setting, and you probably would need to actually have a skybox.

    https://docs.unity3d.com/Manual/class-Camera.html
     
  3. tclancey

    tclancey

    Joined:
    May 19, 2017
    Posts:
    143
    Coroutines seem not to be the answer. My loop which is proved, with variables which are correct, doesn't do very much and the updating.scene message takes over and I have to kill Unity.

    Quite frankly this is getting boring!
     
  4. tclancey

    tclancey

    Joined:
    May 19, 2017
    Posts:
    143
    You star, no idea how, must have been me, the camera was set of depth. No idea what that does and no idea why I selected it! Thanks again.

    Back to square one!
     
    Joe-Censored likes this.