> For the complete documentation index, see [llms.txt](https://enigma23.gitbook.io/arcadetraincontroller/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://enigma23.gitbook.io/arcadetraincontroller/track/station.md).

# Station

### Station

The station component can be used to have a train automatically stop at a location. It also offers the option to reverse the trains direction (eg: because it's end of the line), and open/ close doors while it's stopped.

Use the station settings scriptable object to manage how trains and stations interact with each other.

<figure><img src="https://2648690392-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyK7GKj6u3h5H6DQar47w%2Fuploads%2FkZiEXoCOaUPblpGBP20L%2FUnity_08xxFDeMSb.png?alt=media&amp;token=3054ba93-2c2d-4b47-81db-0d0621a03fc4" alt=""><figcaption></figcaption></figure>

**Time To Stop** - Tweak this value (in seconds), along with the position of the station collider, to get the train to stop in the correct location at any station using this scriptable object.

**Wait Duration** - How long the train will wait at this station, in seconds, before continuing.

**Instant Stop** - Ignores the Time To Stop value and instantly stops the train.

**Resume Speed** - Sets the speed the train should staart moving at when leaving the station, unless 'Use Previous Speed' is ticked.

**Use Previous Speed** - Caches the speed the train enters the station at, and tells it to resume at that speed when leaving.

**Reverse Train Direction** - Set the train moving in the opposite direction from where it came.

**Ignore Additional Carriages** - If your carriages have colliders, use this to stop events triggering with every carriage. Set this to false for instances where you'd want your train to stop at a location for the train egine and each carriage.

### Creating a Station

You can use the create menu to add a station to your station model: *right mouse click -> e23 -> ATC -> Station*

This will create a new game object (called 'Station') with the Station component, rigidbody (setup correctly) and box collider. Position and resize the game object as required.

<figure><img src="https://2648690392-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyK7GKj6u3h5H6DQar47w%2Fuploads%2FWK523mfjtl9F5U6vJvqI%2FUnity_4zGuHbKu7v.png?alt=media&amp;token=c750f685-86db-4aac-bb0f-aaf58a25e410" alt=""><figcaption></figcaption></figure>

Assign the settings you wish this station to use and you're good to go.

'Ignore First' is present in case your train starts off within the station collider, tick this to stop this interaction (example used in the included demo scene, see the Monorail stations).

<figure><img src="https://2648690392-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyK7GKj6u3h5H6DQar47w%2Fuploads%2FEviEmliWCrnZwpOQR7ui%2FUnity_8G73auxAWk.gif?alt=media&amp;token=8c261663-75df-46d9-b666-71a60c5f9109" alt=""><figcaption></figcaption></figure>

With 'Ignore Additional Carriages' set to false, each object that hits the station trigger will stop the train. This could be useful, for example, with a cargo train stopping to fill/ empty each bucket being pulled.

<figure><img src="https://2648690392-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyK7GKj6u3h5H6DQar47w%2Fuploads%2FR1MspnD3MNyt4Obkh3kZ%2FUnity_2LYcE5HRWe.gif?alt=media&amp;token=e1db1b00-6b7c-490d-b9c6-b1bdd502dd06" alt=""><figcaption></figcaption></figure>
