🤔 Unity, huh, how?

🤔

NullReferenceException: UnityEngine.Object — Camera.main

Camera.main will return null if there isn't an enabled camera tagged as MainCamera.

Resolution

Tag the enabled camera in your scene you intended to find using the built-in MainCamera tag.