Virtual cameras
Each frame the brain picks one virtual camera per output:
- The enabled virtual camera with the highest Priority. Equal priorities pick the camera created first.
- A Camera Zone 2D with the target inside lifts its camera to the zone's priority. On a tie the zone beats an ordinary camera, and the zone entered later beats an earlier one.
camera.BlendToandcamera.Cutoverride everything untilcamera.Release.
The pose comes from the virtual camera's node: its interpolated position and rotation, and Zoom, where 0 keeps the zoom of the Camera 2D. A Camera Follow 2D on the same node replaces the position. The node's transform is never changed; the camera only moves the view.
In Try it, the Director script raises Close, then Tilt, for two seconds each, and the view blends to them and back. Change Zoom, Blend Time or Blend Curve of Close in the Inspector and watch the next blend; the script is under the scene.
Blends
When another camera becomes active, the view blends from the pose it shows now to the new camera over its Blend Time, shaped by Blend Curve. A switch during a blend starts from the current view, never from the old camera. Zoom blends evenly on screen. Blend Time 0 cuts.
Bounds
Use Bounds keeps the visible area inside Bounds, a world rectangle. When the area is smaller than the view on an axis, the view is centred on it there.
Try it
Change the example parameters and compare the result. Reset restores the initial scene.
Scene10 nodes
Scriptmain.aes
package demo
// Director raises Close, then Tilt, for Hold seconds each; the view blends between them.
script Director {
@export var Close ComponentRef<VirtualCamera2D>
@export var Tilt ComponentRef<VirtualCamera2D>
@export var Hold float = 2
var t float
var shot int
func Update(dt float) {
t += dt
if t < Hold {
return
}
t = 0
shot = (shot + 1) % 4
Close.Priority = -1
Tilt.Priority = -1
if shot == 1 {
Close.Priority = 1
} else if shot == 3 {
Tilt.Priority = 1
}
}
}