Vixen
02b45cc4
csharp
public struct TrackedDollyBody

Keeps the camera on a spline, at a position along it.

Read the guide page for this →

Remarks

Cinemachine's Tracked Dolly, and [docs/plan/26]'s largest owed item. That document declined to invent a spline for it — "it would make it the second spline in the engine the moment anything else needs one" — and [docs/plan/31 § T8] is that moment. One asset, two consumers: this and the roads that deform a terrain.

⚠ The track is named, not held. A scene is read by a world that has not run yet, so a handle would name a slot nobody has issued. VirtualCameraSystem.Splines is where the name is resolved, and a camera whose track cannot be found holds its position rather than jumping to the origin.

⚠ Position is a distance in metres, not a parameter. A camera moving at a constant parameter rate speeds up through the wide-open segments of its own track and crawls through the tight ones, which is the classic bug in every dolly ever written — Spline.EvaluateAtDistance is the one that moves at a constant speed.

Fields and properties (5)

  • public string Track

    Which spline asset the camera rides, by name.

  • public float Position

    How far along it, in metres. Clamped to the track, or wrapped if it is closed.

  • public DollyMode Mode

    How the position is decided.

  • public Vector3 Offset

    An offset from the track, in the curve's own frame: X is its side, Y its up.

  • public Vector3 Damping

    How long the camera takes to remove 99 % of its error, on each of the track's axes.

Methods (2)

  • public static TrackedDollyBody On(string track, float position = 0)

    A camera riding a named track, driven by the author.

  • public static TrackedDollyBody Following(string track, float damping = 0.4)

    A camera that slides along a track to stay beside what it follows.

Used by (6)

  • ComponentRegistrationVixen.Engine
  • TrackedDollyTestsVixen.Engine.Tests
  • TypeRegistrationVixen.Engine
  • VirtualCameraSystemVixen.Engine
  • Vixen_Engine_Cameras_TrackedDollyBodySerializerVixen.Engine
  • MaterialIconsVixen.Editor.App