0

I keep getting this error in the play mode:

"There is no 'Camera' attached to the "ARCamera" game object, but a script is trying to access it."

This is in spite of having Camera (MainCamera) as a child of the ARCamera. Furthermore, I cannot find the script that uses the 'Camera' component.

Hence, I only get a black screen in game view and when building the app.

Tân
  • 1
  • 15
  • 56
  • 102
  • Well normally there should not be MainCamera as a child of ARCamera of Vuforia. Are you creating it using GameObject->Vuforia->AR Camera or doing something else? – Ali Kanat Nov 12 '18 at 08:22
  • The camera component has to be on the same GameObject. It doesn't have to be the main camera, though – derHugo Nov 12 '18 at 17:36
  • I added the Camera from GameObject -> Camera. It just has the Tag "MainCamera" but I'm not quite sure if it's affecting the performance. I just loaded the project from https://github.com/KeyStarr/Real-World-Object-Recognizer-Unity in which it was made in a different version of Unity so some scripts are missing such as the "HideExcessAreaBehaviour" that should have been a component of the Camera. – IRISistable Nov 14 '18 at 04:13

1 Answers1

0

You could create the camera again, and try and reference it using the index. (transform.getchild(**index of camera in hierarchy**))