Skip to content

Routes & Rails

Rail routes use CargoRoute with Transport Mode set to Rail.

Grid Rule

Smart rail generation expects clean grid placement.

Important

Place rail nodes on a 4m grid. X and Z positions should be multiples of 4.

Straight rails use one grid cell. Small corners and large corners use configured cell sizes.

Default settings:

  • Smart Rail Grid Size: 4
  • Small Corner Cells: 2
  • Large Corner Cells: 4
  • Small Corner Exit Offset: 2

Connection Points

Add CargoRailConnectionPoint children to node prefabs when rails should enter or exit from specific positions.

Recommended setup:

  • one Start point
  • one End point
  • each point should face away from the node
  • point positions should also stay on the grid

The route connects:

  • previous node End
  • next node Start

Building Smart Rails

  1. Select the route.
  2. Make sure rail prefabs are assigned.
  3. Use Build Smart Rail Visuals from the context menu or the Cargo Network window.

The route creates a Route Visuals child object and places generated rail pieces under it.

Loop Routes

When Loop is enabled, the last stop connects back to the first stop.

For two nodes in a straight line, you usually do not need visual loop rails. Leave Loop disabled and the train will ping-pong between endpoints.

Non-Loop Routes

Non-loop routes do not stop forever at the last node. Vehicles reverse direction and continue:

A -> B -> C -> B -> A

For two nodes:

A -> B -> A -> B