Search Unity

Unity 2019.1.7f crash because of rigidbodies

Discussion in 'Physics' started by SparrowGS, Jun 22, 2019.

  1. SparrowGS

    SparrowGS

    Joined:
    Apr 6, 2017
    Posts:
    2,536
    Hey, I have a project that is upgraded to 2019.1.7 from 2017.4, i've already fixed all the problems that was in the console, upgraded to the HDRP, etc.

    Now I get a crash mid-way though the game and all I know is it's because of the rigidbodies, I don't know exactly what or why.
    I have rigidbodies moving on the game from the start, but the crash only happens after a unit dies, destroys itself and releases a empty game object from being its child and enables it, the empty game object contains a shattered version of the unit.
    each mesh has its own rigidbody (the unit has one during the game, and on death each piece of debris is a separate game object with a rigidbody)

    I tested every line of logic from the function that kills them, all good.
    I've recreated the crash by hand during playmode, here's a video:
    the crash happens when I hit "Delete" on the unit.


    also attached is what I could get from VS, though it doesn't tell me much.
    anybody knows whats up with this?, any help is appreciated.
     

    Attached Files:

    Last edited: Jun 22, 2019
  2. SparrowGS

    SparrowGS

    Joined:
    Apr 6, 2017
    Posts:
    2,536
    Huh,


    edit:
    So I "solved" it for now by not destroying the main object but disabling it and when the match is over I make sure I destroy the derbies before the main object.

    Lucky this project can take it as each match about 10-15 minutes before you return to menu and I clean up everything, but this problem can wreck havoc on other projects.
     
    Last edited: Jun 24, 2019