# RailFollow

FRailFollow places camera on a given rail. You can set different modes to move camera.

Before using this component, you need to first add a rail actor to your level. Click "Add"->"All Classes" and search for "Rail", select the "Camera Rig Rail" actor and place it in level anywhere you want.

<figure><img src="https://1253177398-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIc7aRtmwmEkkqEJZORmC%2Fuploads%2FYKbU8zRmyfamKusNHejQ%2Fadd-rail.png?alt=media&#x26;token=27de0c16-b5a6-47d5-8809-51fcde46a527" alt=""><figcaption></figcaption></figure>

Then you may want to set up some of the spline properties. Select the rail actor and at the `Details` panel select the `Rail Spline Component`, you will see the properties under the `Spline` group. If you would like to show debug information, you can enable the `Draw Debug` option. If you would like close the spline, i.e., connecting the end point and the start point of the spline, you can enable the `Closed Loop` option.

<figure><img src="https://1253177398-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIc7aRtmwmEkkqEJZORmC%2Fuploads%2FDiX91aDW0OkLYVyggrWU%2Frailfollow.png?alt=media&#x26;token=15813451-5b51-4c38-8c38-4c9b881d07a5" alt=""><figcaption></figcaption></figure>

<table><thead><tr><th width="154.33333333333331">Parameter</th><th width="107"></th><th>Description</th></tr></thead><tbody><tr><td>Rail</td><td></td><td>The rail on which the camera is placed. You must specify a valid rail actor to this property or this component will not execute correctly.</td></tr><tr><td>Lock Orientation to Rail</td><td></td><td>Whether the orientation of camera should aligh with the rail (in the direction of tangent). If you enable this, you should not use any aim component, otherwise it will override this property.</td></tr><tr><td>Follow Type</td><td></td><td>How do you want the camera to move on rail. <em>Follow Target</em> enforces camera to find the closest position on rail to the target actor. <em>Fixed Speed</em> pushes camera to move at a fixed speed. <em>Manual</em> requires you to set key points on rail and then camera will move to these key points in the order you specify.</td></tr><tr><td>Damping</td><td></td><td>Damping time to follow the target actor. Only editable when <em>FollowType</em> is <em>FollowTarget</em>.</td></tr><tr><td>MaxVelocity</td><td></td><td>Max velocity (absolute value) when <em>FollowType</em> is <em>FollowTarget</em>.</td></tr><tr><td>Start Position</td><td></td><td>A floating point number within [0,1] indicating the start position on rail. Only editable when <em>FollowType</em> is <em>FixedSpeed</em>.</td></tr><tr><td>Duration</td><td></td><td>Camera move duration. Set as 0 for infinite move. Only editable when <em>FollowType</em> is <em>FixedSpeed</em>.</td></tr><tr><td>Speed</td><td></td><td>Camera move speed (per second), in percentage of the overall rail length. Can be negative where camera moves backwards. Only editable when <em>FollowType</em> is <em>FixedSpeed</em>.</td></tr><tr><td>Loop</td><td></td><td>Whether to loop through the rail when camera reaches position 0 or 1. Only editable when <em>FollowType</em> is <em>FixedSpeed</em>.</td></tr><tr><td>Manual Key Points</td><td></td><td>A starting position on rail and a set of key points defining the destination position on rail and blend settings. Only editable when <em>FollowType</em> is <em>Manual</em>.</td></tr><tr><td></td><td>Start Position</td><td>Where should camera start on rail. Must be within [0,1].</td></tr><tr><td></td><td>Position</td><td>Destination position on rail of current key point. Must be within [0,1].</td></tr><tr><td></td><td>Blend Time</td><td>How long does it take to blend from previous key point to this one.</td></tr><tr><td></td><td>Blend Func</td><td>The function used for blending.</td></tr><tr><td></td><td>Duration</td><td>How long does camera stay at this key point.</td></tr><tr><td></td><td>Forward</td><td>Going forward or backward.</td></tr><tr><td>Reset on Resume</td><td></td><td>If transitioning from other cameras to this camera, whether to reset all variables and have camera move from scratch. For example, say you are using a <em>Manual</em> rail camera at first and disable <em>Reset on Resume</em>. When camera temporarily blends to another and then blends back, the camera will continue at where it is interrupted by that temporary cut.</td></tr><tr><td>Follow Target</td><td></td><td>The following target actor. You should specify it in node <code>CallCamera</code> in blueprint.</td></tr><tr><td>Follow Offset</td><td></td><td>The offset camera tries to keep with respect to the target actor. Not applicable for this component.</td></tr><tr><td>Socket Name</td><td></td><td>Optional SocketName. If this socket can be found, its transform will be used. You should be very CAREFUL of the socket's rotation, since the final location is based on the local space. DOES NOT apply to OrbitFollow and CraneFollow.</td></tr><tr><td>Stage</td><td></td><td>Stage at which this component is executed. You can only change this property at the "Class Defaults" window.</td></tr></tbody></table>
