"UnassignedReferenceException: The variable player of CameraController has not been assigned. You probably need to assign the player variable of the CameraController script in the inspector."

Hi all! I have a problem with Unity. The “CameraController” script was working fine until something went wrong and the error

UnassignedReferenceException: The variable player of CameraController has not been assigned.
You probably need to assign the player variable of the CameraController script in the inspector.

Before this there was a slightly different error, but now it shows this one. If anyone knows how to fix this, please help :slight_smile:

Looks as though you have changed the player or removed it from the scene so the camera is not picking it up. In the inspector go onto the CameraController and drag the player into the “player” spot. Alternatively if its a custom script for the camera, you can type in Void Start

player = GameObject.Find(“PlayerGameObject”);

“PlayerGameObject” means whatever you have named the player, don’t just type that in lol