Stride

OPEN / CLOSE
  • Features
  • Blog
  • Documentation
  • Community
(icon) Download

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

OPEN / CLOSE
  • English
  • 日本語
    Show / Hide Table of Contents

    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 Stride, 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 enabled

    If you create your camera components in code, make sure you retrieve the correct slot from the graphics compositor. Use:

    var camera = new CameraComponent();
    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

    • Graphics — Camera slots
    • Graphics — Cameras
    • Improve this Doc
    In This Article

    Back to top

    Copyright © 2019-2021 .NET Foundation and Contributors
    Supported by the .NET Foundation