Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

When a level is generated, all the room templates that are used in the level are instantiated and moved to the correct positions. If there were some missing references, it may be because you generated a level, then referenced something in the level, then generated the level again and all the references got lost. However, I'm not sure why should you lose a reference to your camera. If you don't create the camera at runtime, the reference should always be the same. Moreover, keep in mind that it takes some time to generate a level. That means that if you run some code in on of the Start()/Awake() methods, some game objects may not exist yet. For example, if your player game object is part of a room template, it'll be present in the scene only after a level is generated so if you try to find it by its tag before that, you won't find anything.  The correct approach to that is to have the game object always present in the scene or make sure that you use it only after a level is generated (for example in a custom post-processing task as described in the docs).