Docs / Camera

Glossary: AnimatedCameraController

The members of AnimatedCameraController, in alphabetical order.

Color legend plain property method

Moves its camera along a camera path at a cruise speed, easing and holding where the path’s waypoints say, with play, pause and seek, and eases the camera onto the path when attached.

AnimatedCameraController derives from BaseCameraController and has its members too. The path playback page shows it in context, with code.

Names are colored by what they are: a property or a method; values and fields keep the plain color.

Properties

DurationSec →

float · The seconds of one run from end to end, easing and holds included, while Timing is Duration. 8 by default. The holds take their seconds and the travel the rest, at the path’s CruiseSpeed for the duration; without easing or holds, that is the path’s Length over it. Travel gets at least a tenth of the duration, so holds that alone would fill it make the run longer. For a set speed, use SpeedUnitsPerSec instead. At 0 or less, the camera doesn’t move along the path.

EntryBlendDurationSec →

float · The seconds the camera takes to ease from its pose onto the path when the controller is attached, starting and ending gently. 2 by default; 0 or less jumps.

IsPlaying →

bool · Read-only. Whether the camera is moving along the path, holds included. false for a new controller, and again once a Stop path reaches its end and its last waypoint’s hold is over.

OpenPathAnimationMode →

CameraAnimationMode · What an open path does at its ends. Stop by default. A closed path always goes round.

Path →

CameraPath · The path to follow. An empty path of its own by default. Throws ArgumentNullException for null.

PathDistance →

float · Read-only. Where the camera is, as a distance along the path in world units. Set by Seek, SeekNormalized and, on attachment, SnapToNearestOnEntry. While playing, the path’s DistanceAtTime for the camera’s time into the run; an overshooting ease at an end of an open path can take it a little outside 0 to Length, where the camera stays at the end.

SnapToNearestOnEntry →

bool · Whether attaching starts from the point of the path nearest the camera, at the matching point of the run as a seek does; off, it starts from PathDistance. On by default.

SpeedUnitsPerSec →

float · The cruise speed, in world units a second, while Timing is Speed: the camera’s speed wherever no waypoint eases. 5 by default. A run takes the path’s TravelTime at it, and the speed stays as it is when the path changes length mid-run: the run takes longer or shorter instead. At 0 or less, or not a finite number, the camera doesn’t move along the path.

Timing →

CameraPathTiming · What sets the length of a run: DurationSec for Duration, the default, or SpeedUnitsPerSec for Speed. The other setting is kept, unused. Changing it while playing carries on from the same share of the run.

Methods

AnimatedCameraController() →

AnimatedCameraController() · A paused controller with an empty path, timed by an 8-second duration, a speed of 5 units a second for timing by speed, the Stop mode, a 2-second entry blend and SnapToNearestOnEntry on.

AddWaypoint() →

AddWaypoint(Camera camera, CameraWaypointOrientationMode mode = Fixed, Vector3? lookAt = null) · Adds a waypoint at the end of Path, at the camera’s position. The controller doesn’t need to be attached to that camera. Throws ArgumentNullException for a null camera.

Parameter Type Description
camera Camera The camera whose position, and for Fixed whose orientation, the waypoint takes.
mode CameraWaypointOrientationMode Fixed keeps the camera’s orientation, LookAtTarget faces lookAt, TangentFollow faces along the path. Default: Fixed.
lookAt Vector3? The point a LookAtTarget waypoint faces. Default: null, the origin.

Pause() →

Pause() · Holds the camera where it is on the path; the controller still keeps it there.

Play() →

Play() · Starts moving along the path. At the end of an open path in the Stop mode, starts over from the beginning.

Seek() →

Seek(float pathDistance) · Moves to the distance along the path, clamped to 0 to its Length, and to the matching point of the run’s timing, from the path’s TimeAtDistance: the easing and holds ahead play out as they would have, and at a waypoint that holds, the camera holds first. The camera gets there at its next update.

Parameter Type Description
pathDistance float In world units from the start of the path.

SeekNormalized() →

SeekNormalized(float value) · Moves to a fraction of the path’s length, as Seek does: a fraction of its distance, not of its time.

Parameter Type Description
value float 0 for the start, 1 for the end; clamped to 0 to 1.

Update() →

Update(float elapsedSeconds) · Override. Moves through the run’s time while playing, easing and holding where the waypoints say, eases in after an attachment, and sets the camera’s position and orientation. Does nothing while the path has no waypoints. The camera calls it.

Parameter Type Description
elapsedSeconds float The seconds since the last update.