Camera Not assigned ...

Hi everyone,

I got an stupid issue.

I assign my camera in the myCamera variable in the editor for the script “FieldManager06Behaviour” but i still got the error message.

UnassignedReferenceException: The variable myCamera of ‘FieldManager06Behaviour’ has not been assigned.
You probably need to assign the myCamera variable of the FieldManager06Behaviour script in the inspector.
FieldManager06Behaviour.createGame () (at Assets/Scene06/FieldManager06Behaviour.js:69)
MenuManager.Update () (at Assets/SceneMenu/MenuManager.js:111)

I’m stuck. Do you have an idea ?

best regards

You have the run button on in the editor. It could be you assigned it that way, which is temporary. It has to be assigned with the run button off. Other than that, I don’t know.

The game object you’ve selected, FieldManager_6, probably isn’t then one that is producing the error. You’ve most likely attached this script to multiple objects, at least three by the looks of it, since there are three identical errors in the console log and you have Clear on Play enabled (which means the errors are probably all from the most recent run), and you’ve failed to set the myCamera field on those instances.

Thanks for your reply.

Everythings has been assigned before I hit the run button (I’m not trying to tricks you :slight_smile: ). And this script is only assigned to one object. You can see the same message sevral times cause it’s using the camera each frame (on the Update call) .

I finally change to a GameObject.Find(“MyCamera”) but what really bugs me is that the FieldManager_2 to FieldManager_5 are working just fine.