> 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/creating-a-track.md).

# Creating a Track

There are only two components that are required for a working track. A SplineContainer and a TrackPathManager.

It's best to first create an empty game object per track. Helps to keep everything tidy and reposition easier.

<figure><img src="https://2648690392-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyK7GKj6u3h5H6DQar47w%2Fuploads%2F0Lb27SwqOVyNzTJhhRp8%2FUnity_sLoR285owU.png?alt=media&amp;token=6f380080-5680-4e65-8be4-63efba8ea58e" alt=""><figcaption></figcaption></figure>

### SplineContainer

The SplineContainer is the component needed to create, draw and manipulate splines. Follow the insctructions in the Unity documentation on how to draw and edit a spline - [link](https://docs.unity3d.com/Packages/com.unity.splines@2.8/manual/create-a-spline.html).

First create a SplineContainer and then add some knots to create a spline path.

<figure><img src="https://2648690392-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyK7GKj6u3h5H6DQar47w%2Fuploads%2FV6pNnL9wJbFhnVbeQLmg%2FUnity_IiOjku2xAd.gif?alt=media&amp;token=48a00d8d-498e-4819-aab6-528f5e267fa9" alt=""><figcaption></figcaption></figure>

### Track Visual

Once your spline is created and lay out how you want, at least for now, it's a good idea to be able to see the track! Use the right mouse create menu to add a 'Track Visual' as a child of the 'TrackSpline' game object.

<figure><img src="https://2648690392-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyK7GKj6u3h5H6DQar47w%2Fuploads%2FeKWVJpr4znKHlsYuXG8Z%2FUnity_9qY50sR5Gx.png?alt=media&amp;token=5c1f3d2a-b778-4873-8fed-9855c97653f5" alt=""><figcaption></figcaption></figure>

Change the field 'Visual Name' to something descriptive. Note: if you leave it at RenameMe and then generate any other meshes the the default values, the mesh will be overwritten each time.

The Spline Container should have automatically been assigned, if it hasn't been assign the container you wish to generate a mesh for.

Assign a source mesh. This should be a piece of modular (repeatable) track, a simple one is included with ATC.

<figure><img src="https://2648690392-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyK7GKj6u3h5H6DQar47w%2Fuploads%2FX2CUmRUWMH7wpd7ulGJ9%2FUnity_BfAcce14zq.png?alt=media&amp;token=71365589-e7a8-466b-8a05-055100cfbeb6" alt=""><figcaption></figcaption></figure>

Everything else will most often be left at the default values, though you may wish to tweak the 'Samples Per Tile' value.

Now it's time to build the visual. Right  mouse click on the component title -> Rebuild. After the mesh is generated you'll want to assign a material to the Mesh Renderer.&#x20;

Generated meshes are saved in the project window in a new folder next to the active scene. EG: Packages/e23 Arcade Train Controller/Samples/DemoScene/e23.GeneratedMeshes/

<figure><img src="https://2648690392-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyK7GKj6u3h5H6DQar47w%2Fuploads%2F6y55VMzckzuTLNMzqIwp%2FUnity_80Gu52CR9p.gif?alt=media&amp;token=7267b2bc-bbda-4858-a61e-80522a805f64" alt=""><figcaption></figcaption></figure>
