Core - Variables


bool Active

Determines if the Railcam2DCore component controls camera movement.

Set to false to release the camera at its current position. Useful when you want other components to move the camera without Railcam 2D interfering.

Update Method

Railcam2D.UpdateMethod UpdateMethod

The Update method used to move the camera.

An enum with a choice of LateUpdate or FixedUpdate. If the Target is moved with physics, consider using FixedUpdate. If the Target is moved outside the physics loop, consider using LateUpdate.

Start On Rail

Railcam2D.Rail StartOnRail

The Rail component the camera starts the scene on.

Set to null ("-" in the editor) to prevent the camera starting on a Rail.


Transform Target

The Target the camera's Rail and Trigger components use by default, and the object the camera follows when not on a rail.

Usually a player-controlled object.


bool FollowX

bool FollowY

Determines if the camera follows the Target along the given axis.

Value is disregarded when the camera is on a rail.


[Range(-1.0f, 1.0f)]
float OffsetX

[Range(-1.0f, 1.0f)]
float OffsetY

Offsets camera position along the given axis.

Value range of -1 to +1 represents screen size.


float SmoothX

float SmoothY

Smooths camera movement along the given axis.

Set to 0 to prevent smoothing. Value is approximately the time in seconds the camera takes to reach the IntendedPosition.


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

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

Prevents the camera moving too far away from the IntendedPosition along the given axis, so that the IntendedPosition never goes off screen.

Set to 0 to prevent bounding. Value range of 0 to +1 represents maximum distance the camera can be away from the IntendedPosition, with +1 representing half screen size.