Error: "A SceneCameraRenderer in use has no camera assigned to its [Slot]. Make sure a camera is enabled and assigned to the [Slot]."

Note

In earlier versions of Xenko, this error message was: "A SceneCameraRenderer in use has no camera set. Make sure the camera component to use is enabled and has its [Slot] property correctly set."

This error means there's no camera available for the scene renderer to use. This has several possible causes:

  • there's no enabled camera
  • the camera is set to the wrong camera slot
  • there are multiple enabled cameras assigned to the same camera slot

Fix

If you create your camera components in Game Studio, make sure:

  • the camera slots are set to the Main slot (see Graphics — Camera slots)
  • only the initial camera is enabledIf you create your camera components in code, make sure you retrieve the correct slot from the graphics compositor. Use:
  1. var camera = new CameraComponent();
  2. camera.Slot = SceneSystem.GraphicsCompositor.Cameras[0].ToSlotId();

To change the camera at runtime, toggle the Enabled property.

Note

Make sure you:

  • always have at least one enabled camera

  • don't have multiple cameras enabled and assigned to the same slot at the same time

See also