Camera
Camera is used to display the objects in your scene.
Add a Camera Component
To add a Camera component:
- Go to the Inspector panel
- Click the + Add Component button
- Go to Scene
- Select Camera
Properties
Property | Description |
---|---|
Layers | Render 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 Texture | Set 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 Mask | Enables or disables the Mask Texture property. |
Mask Texture | Sets the target mask texture for the Camera component. You can import a texture directly in the Inspector panel. |
Render Order | A 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). |
Viewport | Indicate where on the screen the camera is viewing. See the demonstration below.
|
Camera Type | How the camera projects the scene objects onto the screen.
|
FOV (Field of view) | The view angle of the camera. Only applies to a perspective camera. |
Ortho Height | The height of the camera clip plane. Only applies to an orthographic camera. The max value is 99. |
Near | The closest distance the camera can render. |
Far | The furthest distance the camera can render. |
Clear Color Type | Defines what to use to fill the previous render texture:
|
Clear Color | If Clear Color Type is set to Color, the render texture of the camera will be filled with the selected solid color |
Texture | If Clear Color Type is set to Texture, the render texture of the camera will be filled with the selected texture |
Clear Depth | When checked, clears the depth buffer from the previous render texture. It redetermines the depth when drawing the new render texture. |
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.