Skip to main content
Version: 3.7.0

Camera

Camera is used to display the objects in your scene.

properties

Add a Camera Component

Add a Camera component by clicking + Add Component > Scene > Camera in the Inspector panel.

Properties

PropertyDescription
LayersRender all scene objects that are set to the selected layers. You can select multiple layers for one camera. Select Default Layer, or from Layer 1 to Layer 63.
Render TextureSet the render output of the camera to a render texture. You can use the default render texture, Final Render Output. This render texture uses the webcam video frame by default so it shows what the webcam or phone camera is viewing. Alternatively, you can create a new render texture and assign it to this property.
Enable MaskEnables or disables the Mask Texture property.
Mask TextureSets the target mask texture for the Camera component. You can import a texture directly in the Inspector panel.
Render OrderA camera with a higher render order will render in front of camera with a lower render order (or the higher the render order, the later it will render).
ViewportIndicate where on the screen the camera is viewing. See the demonstration below.
  • X: The beginning horizontal position of the camera view.
  • Y: The beginning vertical position of the camera view.
  • W: The width of the camera output on the screen.
  • H: The height of the camera output on the screen.
Camera TypeHow the camera projects the scene objects onto the screen.
  • Perspective: Simulate how perspective and depth-perception work in the real world. Everything looks smaller in the distance and larger when they are closer to the camera.
  • Orthographic: This does not represent the object as it would be recorded photographically or perceived by a viewer observing it directly. It is a parallel projection where the lines will stay parallel in every circumstance.
FOV (Field of view)The view angle of the camera. Only applies to a perspective camera.
Ortho HeightThe height of the camera clip plane. Only applies to an orthographic camera. The max value is 99.
NearThe closest distance the camera can render.
FarThe furthest distance the camera can render.
Clear TypeDefine what to use to clear the previous frame.
  • Color: Fill the render texture with the selected solid color.
  • Depth: Clear the depth buffer from a previous render texture. Redetermine the depth when drawing the new render texture.
  • Color Depth: Fill the render texture with the selected solid color. Clear the depth buffer and color buffer from a previous render texture.
  • Don’t: Do not clear any buffer the from the previous render texture.
  • Depth Stencil: Clear the depth buffer with a stencil buffer from a previous render texture.
  • Color Depth Stencil: Fill the render texture with the selected solid color. Clear the depth buffer with both a stencil buffer and color buffer from a previous render texture.
Clear ColorIf Clear Type is set to Color, Color Depth, or Color Depth Stencil, the render texture of the camera will be filled with the selected solid color.
tip

When there are multiple cameras in the scene, you need to change layers as well as the render order. If camera A’s render order is 3, in order to make camera B be rendered on top of camera A’s rendering result, you should set camera B’s render order to be greater than 3.

Demonstrations

Viewport

viewport
view 1   view 2   view 3
view 4   view 5   view 6