Search Unity

Unity 2019.3.15f1 crashes on making gameobject active

Discussion in 'Editor & General Support' started by Sergey_Droba, May 29, 2020.

  1. Sergey_Droba

    Sergey_Droba

    Joined:
    Nov 6, 2016
    Posts:
    52
    Hi,
    I have an issue in my game from 2019.3.12f1 and it still exists until 2019.3.15f1

    When I trying to make object active Unity crashes, It happens in the current moment of the game,
    but it doesn't happen on any version lower than 2019.3.12f1

    It happens on windows and mac on any configurations.
    I reported it and sent my project but no response.

    I recorded the video how that happens


    Please help.
     
    Last edited: May 30, 2020
  2. DiegoDePalacio

    DiegoDePalacio

    Unity Technologies

    Joined:
    Oct 28, 2009
    Posts:
    507
    Hi @Sergey_Droba,

    My recommendation is:
    1. Check which components are attached to such GameObject;
    2. Check the initialization code (in `Awake` and `Start` usually), looking for something that could be the cause of the crash;
    3. Check the code that is executed on such components after the initialization (usually in all `Update` methods), trying to find the issue there;
    4. If you can't find anything wrong, try also the use breakpoints on those components, checking which ones are called and going also step by step to find where the crash is happening;
    5. Finally, if you can't find anything yet, you can try by removing/disabling some of those components and check if you can find the one that is causing the crash.

    I hope it helps!
     
  3. Sergey_Droba

    Sergey_Droba

    Joined:
    Nov 6, 2016
    Posts:
    52
    Thank you for your answer,
    but everything works fine on 2019.3.11 and lower
    There is nothing wrong with components or scripts because the object already instantiated, that script just makes some active from a pool.
    I can send you my project if you can check.
     
  4. DiegoDePalacio

    DiegoDePalacio

    Unity Technologies

    Joined:
    Oct 28, 2009
    Posts:
    507
  5. Sergey_Droba

    Sergey_Droba

    Joined:
    Nov 6, 2016
    Posts:
    52
    I did but no response 2 weeks,
    and not fixes, the next release has this bug.
     
  6. DiegoDePalacio

    DiegoDePalacio

    Unity Technologies

    Joined:
    Oct 28, 2009
    Posts:
    507
    Hi @Sergey_Droba,

    Are you checking, from time to time, the status of your bug report with the hyperlink that was sent to you after submitting the bug report, right?
     
  7. Sergey_Droba

    Sergey_Droba

    Joined:
    Nov 6, 2016
    Posts:
    52
    Of course,
    it looks like I managed to avoid the crash, but the reason was weird.
    All next happens in OnEnable()
    I have an animator that I should save and reset every time since I use the pool of objects.
    var animController = anim.runtimeAnimatorController;
    anim.runtimeAnimatorController = null;

    I don't remember why I set it null, it might have remaining animations after enable, so I should save the animatorController.
    After some lines, I have this:
    anim.runtimeAnimatorController = animController; - it cause the crash

    But if I comment the previous line, the crash not happens.
    // anim.runtimeAnimatorController = null;

    This issue began from 2019.3.12f1
    But it is not reproducible with a new clear script.
     
  8. DiegoDePalacio

    DiegoDePalacio

    Unity Technologies

    Joined:
    Oct 28, 2009
    Posts:
    507
    I'm glad that you find a way to avoid the crash!