Search Unity

Unexplained error, m_InstanceID == 0

Discussion in 'Editor & General Support' started by MADmarine, Nov 23, 2010.

  1. MADmarine

    MADmarine

    Joined:
    Aug 31, 2010
    Posts:
    627
    Hi guys,

    Recently I keep getting this error popping up after stopping my application, and when I try to do anything else like save or run the program again Unity just crashes.

    At the bottom of the console it says this is triggered on line 6 of BaseObject.h, but obviously that's no help to me.

    After starting up Unity again one of my prefabs flags up that it can't be re-imported but that's my only clue to go on. Has anyone ever encountered m_InstanceID == 0 before? What does it mean and how can I fix it?
     
    Last edited: Nov 23, 2010
  2. andeeeee

    andeeeee

    Joined:
    Jul 19, 2005
    Posts:
    8,768
    There seem to be a few places where this message can occur. Is the prefab corrupt or does it fail to instantiate or anything like that? Does the project work if you remove the prefab?
     
  3. MADmarine

    MADmarine

    Joined:
    Aug 31, 2010
    Posts:
    627
    I've been investigating into that prefab and yes, it is the reason for the problem, but the prefab works absolutely fine.

    The prefab adds a box collider to itself at run-time and then destroys it before the application closes. Unity seems to think that the prefab still has a box collider when it tries to re-import it and that's what's causing the problem.

    I've tried completely re-making the prefab from scratch but the problem still persists, I don't get why the prefab will be changed when the box collider is only added to instantiated types though.
     
  4. andeeeee

    andeeeee

    Joined:
    Jul 19, 2005
    Posts:
    8,768
    This has been reported as a bug but if you could file a new bug report and mention that it may be related to case 333505, it might help diagnose the problem.

    Does your code actually modify the prefab itself or just an instance? If you can rewrite the code so it doesn't change the prefab (if that is what it is doing) then it might offer a workaround.
     
  5. MADmarine

    MADmarine

    Joined:
    Aug 31, 2010
    Posts:
    627
    Looking at my code again I found that I wasn't making a copy of the prefab like I thought, I was just referencing it then changing a few parameters before instantiating it. Stopping these modifications to the prefab solved the problem, thanks.
     
  6. jtsmith1287

    jtsmith1287

    Joined:
    Aug 3, 2014
    Posts:
    787
    What!? This has been a bug for 5 years!?!?! This is an incredibly horrible bug. If you lose a prefab that's referenced in that scene the whole scene breaks. I've experienced several different ways a prefab can become corrupt and all of them cause the same kinds of issues. Can't save the scene, or can't load the scene, or can't build the scene. I've been thinking it was a Unity 5 bug this whole time because I didn't experience it until recently. 5 years this has been an issue though. Wow. Every time this happens I have to reset from git to a previous commit and figure out what I did to cause the issue and move forward from there. It's costing me a ton of time.

    I am curious though, because this issue is m_InstanceID == 0, but I'm experiencing an m_InstanceID != 0. So.. what's it supposed to be, lol? If it helps my case for this similar issue is 691967.
     
  7. sebastiansgames

    sebastiansgames

    Joined:
    Mar 25, 2014
    Posts:
    114
    I'm getting this too...
     
  8. sirdudalot

    sirdudalot

    Joined:
    Nov 22, 2015
    Posts:
    6
    I've had the m_InstanceID != 0 s bad for a while. Just today I tried...
    if ((c.gameObject.activeSelf) && (cc.gameObject.activeSelf))
    {
    Physics2D.IgnoreCollision(c, cc, setignoreto);
    }
    ... and it cleared it up. Not sure if that's helpful, but there's not a lot of good info on the "m_InstanceID != 0" problem(s), hope this helps someone.
     
  9. gamecreater2

    gamecreater2

    Joined:
    Jan 15, 2019
    Posts:
    1
    this problem has been in unity for 10 years wow just wow