Rail - Variables

Target

Transform Target

The Target the camera follows while on the Rail.

If null, the Target of the Railcam2DCore component is used by default. Only assign a value if you want the camera to temporarily follow a different object, such as a moving obstacle or enemy.

Orientation

Railcam2D.RailOrientation Orientation

The axis used to calculate camera position while on the Rail.

An enum with a choice of Horizontal or Vertical. The value determines whether the camera follows the target's x-position or y-position.

FX: Lead-In

[Range(0.0f, 1.0f)]
float LeadIn

A transition effect that creates a leading camera with reduced velocity between the first two Rail nodes.

Value range of 0 to +1 represents the camera's start position between the nodes, with 0 representing the first node's position. The camera's velocity is inversely proportional to this value, meaning both the camera and target reach the second node together.

FX: Trail-Out

[Range(0.0f, 1.0f)]
float TrailOut

A transition effect that creates a trailing camera with reduced velocity between the final two Rail nodes.

Value range of 0 to +1 represents the camera's end position between the nodes, with 0 representing the final node's position. The camera's velocity is inversely proportional to this value, meaning the camera reaches the end position as the target reaches the final node.

Nodes

List <Railcam2D.RailNode> Nodes

The list of nodes that define the Rail's path.

Rail Node Variables

The following variables can be accessed through using the Rail.Nodes[n]. prefix, where n is the index of the node being accessed.

Position

Vector2 Position

The position of the node in the scene.

FX: Threshold

[Range(0.0f, 1.0f)]
float Threshold

A transition effect that holds the camera at the current node, and then moves it with increased velocity to reach the next node as the target does.

The camera is held at the current node until the target reaches a distance between the current node and the next node that is proportional to the Threshold value. The camera is then moved with a velocity that is inversely propeortional to the Threshold value so that it reaches the next node at the same time as the target.

Invert FX: Threshold

bool InvertThreshold

Inverts the Threshold effect, causing the camera to move with increased velocity to the next node and then wait for the target to catch up.