> For the complete documentation index, see [llms.txt](https://llando.gitbook.io/ttsystem/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://llando.gitbook.io/ttsystem/guides/adding-new-tracks.md).

# Adding New Tracks

Guide

Tracks are defined by their TrackManager component. Every track must have its own [TrackManager ](/ttsystem/components-prefabs/trackmanager.md)component to represent its layout.

### Adding A New Track In A New Scene:

* By default, the **Complete Time Trial System** package is setup to work with one track per Unity scene as it uses automatic assignment of references to prevent needing to manually assign components.
  * *This is done using FindObjectOfType\<TrackManager>() in Awake of LapTimeTrackingObject so fails with more than one TrackManager in the scene.*
* This has the benefit of being easy to use at the downside of flexibility. Should you prefer having multiple tracks per scene or a more flexible solution see the [**Adding New Tracks To The Same Scene**](#adding-a-new-track-to-the-same-scene) section below to see how to handle reference assignment manually instead.
* For adding time trials to a new track in a new scene, simply add a [TrackManager ](/ttsystem/components-prefabs/trackmanager.md)component in that scene, and create the layout of your track as normal.

in [LapTimeTrackingObject.cs](/ttsystem/components-prefabs/laptimetrackingobject.md):

```csharp
private TrackManager currentTrackManager; // Declaration

currentTrackManager = FindObjectOfType<TrackManager>(); // Assignment in Awake()

```

### Adding New Tracks To The Same Scene:

* To add multiple tracks in the same scene, simply modify the [TrackManager ](/ttsystem/components-prefabs/trackmanager.md)reference in [LapTimeTrackingObject ](/ttsystem/components-prefabs/laptimetrackingobject.md)to not use `FindObjectOfType` but instead your own method of choice for assignment.
* This can either be done manually by assigning the references in inspector or through a script that updates the [TrackManager ](/ttsystem/components-prefabs/trackmanager.md)reference as you change track in game.
* This can also be used to provide much more flexibility for time trials in your projects and allows you to update the [TrackManager ](/ttsystem/components-prefabs/trackmanager.md)reference for individual [LapTimeTrackingObjects ](/ttsystem/components-prefabs/laptimetrackingobject.md)at any point during gameplay.&#x20;
* For example, you could have 2 races going on simultaneously in the same Unity scene each making use of time trials for their own [LapTimeTrackingObjects ](/ttsystem/components-prefabs/laptimetrackingobject.md)on each track.

### What Next?

#### [How do I add time trial UI to my project?](/ttsystem/guides/adding-time-trial-ui.md)

#### [How do I make time trial data save across game sessions?](/ttsystem/guides/adding-time-trial-saves.md)
