Virtual Camera 2D
A camera pose the brain can pick. The highest priority wins; switching blends from the current view.
component camera.VirtualCamera2D
On this page
Try it
Select a virtual camera
Priority determines which virtual camera controls the output. This focused scene cuts immediately so the change is clear.
Change the selected Close camera's Priority from -1 to 5 to take over the view. Reset restores the original camera.
Scene9 nodes
Fields
| Name | Type | Default | Description |
|---|---|---|---|
| Priority | int | 0 | The enabled virtual camera with the highest priority drives its output. |
| Output | string | "" | This camera drives. Empty is the main output; a Camera 2D picks another one with Camera Output Selector 2D. |
| Zoom | float | 0 | Pixels per world unit while this camera is active. 0 keeps the zoom of the Camera 2D. ≥ 0 |
| Blend Time | float | 0.5 | Seconds to blend into this camera when it becomes active. 0 cuts. ≥ 0 |
| Blend Curve | Curve | curve | Shape of the blend; its time range is stretched over Blend Time. read-only in scripts |
| Time Domain | enum | unscaled | unscaled blends and shakes in real time, also during hit-stop and pause; game follows the time scale. one of: unscaled, game |
| Use Bounds | bool | false | Keeps the visible area inside Bounds. |
| Bounds | Rect | (0, 0, 0, 0) | World rectangle the view stays inside. A smaller area centres the view on it. |
| Snap To Pixels | bool | false | Rounds the final position to whole screen pixels. pixelPerfect cameras already do this. |
Methods
IsActive method
func (VirtualCamera2D) IsActive() bool
Reports whether this virtual camera drives its output now.
Related guides
- Cameras Camera2D renders an orthographic view from the node's 2D transform.
- Cameras 2D A Camera 2D draws the view; virtual cameras decide where it looks.
- Virtual cameras Each frame the brain picks one virtual camera per output: