Rails
Overview
The Rails extension allows you to define a path that your camera will follow according to your targets position. It’s great for situations where you need that extra control over the camera position but still want the player to dictate its position. One key aspect to understand is that what you’re actually limiting to the path is a target and not the camera itself. This means that you need to add your targets to the Rails extension editor and remove them from the normal ProCamera2D camera targets list.
Editor
Parameters:
Camera Targets
: The targets which you want to keep their positions limited to the path. Remember, you probably want to remove them from the normal ProCamera2D targets listFollow Mode
: You can choose between HorizontalAxis, VerticalAxis or BothAxis. Depending on the direction your targets move you’ll want to experiment what works best for you. On an horizontal platformer you probably want to choose HorizontalAxis
Usage:
- Create nodes: Click on the empty squares in between the other nodes.
- Remove nodes: Hold down
Alt
and click an existing node to remove it. - Snapping nodes: Hold down
Ctrl
(Command
on Mac) and move the node. To adjust the snap value go to Unity > Preferences > ProCamera2D > Rails Snapping