Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Destroy GameObject is superslow in 4.5.2

Discussion in 'Editor & General Support' started by Demigiant, Jul 12, 2014.

  1. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    Beware: destroying multiple gameObjects has become an incredibly slow operation in Unity 4.5.2. It happens only in the Editor though, and I suppose it's due to the new Hierarchy sorting. Still, it's weird because it was a much faster operation in Unity 4.5.1 (even if slower than before), and the new sorting was already implemented.
     
    Last edited: Jul 13, 2014
  2. Graham-Dunnett

    Graham-Dunnett

    Unity Technologies

    Joined:
    Jun 2, 2009
    Posts:
    4,287
    Bug number?
     
  3. Kilrath81

    Kilrath81

    Joined:
    Nov 19, 2013
    Posts:
    153
    I ran into this too. My player gets destroyed on death and re instantiated however he would instantiate and lock up the game with multiple listeners in the scene. I had to add a destroy not only to the player controller but also the the re spawn control.. was ridiculous how a single update can mess up a perfectly working game that badly.
     
  4. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    619326

    P.S. if you read this post before I edited it, I was complaining that I didn't get a bug report notification. Then I did so here's the number: it just took longer than usual, sorry.
     
    Last edited: Jul 13, 2014
  5. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    NOTE: while creating the project for the bug report, I realized that, for example:
    • If you destroy 2000 gameObjects using a loop cycle it is very very very slow
    • If instead those 2000 gameObjects were inside a container, and you just destroy the container, it's fast as usual
    Again, this happens only in the Editor and not in a build