Camera.main error

The problem is the following: The camera is referenced in the “current” scene but it is not persistent. This means that it gets destroyed if a new scene gets loaded or if the current scene gets reloaded. The reference in your persistent objects gets lost.

Solution: When a new scene gets loaded, your persistent object has to look for a camera object again.

The onSceneLoaded delegate might be helpful. Take a look at the example in the API and try to apply it in your own project:


See also: