No-Prebab = fine - Prefab = Crash- Why?

I have a scene that does just what I need it to. I plan on duplicating this scene many times over, so I took all the objects in the scene and put them into a prefab. Now my scene wont load and unity crashes. When I break the prefab link the scene loads fine again. Any way to fix this. I’m using Unity 3 b6. The prefab contains about 30 different objects.

Hi marklennartprice,

I am curious about this one because I planned to do the same thing with one of our games. So let me ask you the steps you took.

  1. you created the scene
  2. you created a prefab
  3. you dumped all the scene objects into the prefab?
    3b) Or did you first created an empty parent object and put all the scene objects under that parent?
  4. you deleted all the objects from the hierarchy (emptied the scene)
  5. then you dropped the prefab back into the hierarchy (scene should show in camera view)
  6. you hit play and it crashes

One thing that comes to mind is question (3b) did you just dump all the objects into the prefab without a parent object linking them in a hierarchy structure or did you create an empty GameObject that acts as the parent to the scene objects - and therefore some kind of hierarchy exists?

I haven’t done this yet but plan to at some point and I was thinking doing the latter method because prefabs tend to like a parent object that is linked to all it’s children.

I suspect that you might have done #3 only and therefore the prefab is confused as to which object in the scene is the main parent. If the objects aren’t “linked” in some kind of parent/child hierarchy the prefab might take a poop.

Just some thoughts.

So I fixed it.

I did all of the above (at least the correct steps). The problem was because I had prefab objects within those 30+ objects (so a prefab within a prefab). Once I made the inner objects into “non-prefabs” it stopped crashing.

So it was the prefab within prefab that was the problem?

You were able to dump all your objects into a single prefab without creating a “global” parent object?

Sorry to confuse, I DID put all objects on a parent object. And also I don’t think I mentioned i’m using Unity 3 b6