"Revert to Prefab" Resets entire Scene

I am making a game which involves creating many similar levels. To cut out much of the initial busy work of setting up each level, I created a prefab called “Level”.

The level prefab is simply a container object that holds:

  • The main camera with custom settings
  • An instance of the player prefab
  • An instance of the exit prefab
  • A blank instance of a custom TileMap prefab
  • An empty “Enemies” game object for storing enemies made during the course of level creation

This setup causes behaviours which I do not understand. For example, I have an enemy prefab called “Poacher”. I drag three instances of the Poacher under the “Enemies” container and position them in the level. Later on I decide to make a change to the “Poacher” prefab. Two things happen which I do not understand:

  1. The change is not propagated to the instances of the poacher I have already placed in the level.
  2. In order to try and force these changes through, I click on one of the Poachers in the inspector and click “Revert”. This causes the entire level to revert back to its original state, including deleting all the enemies, completely clearing the Tilemap and so on.

Is there something in the way I have set up my level prefab, or a misunderstanding of mine about the way in which prefabs work which is causing this to happen?

Bad news: Unity doesn’t support nested prefabs.

If you add a poacher prefab into some other prefab, it loses its original connection and is now part of that other prefab.

Because you’re treating your entire level as one big prefab, you’re losing any and all connections to “child” prefabs that you drop into the level. The whole level is just one big prefab, now.

Any attempt to recover from this would probably involve rebuilding the levels, either by code or by hand, which sounds… painstaking.

Sorry. =\