# Quick Setup

The quick setup guide covers how to get a time trial system working in your project with minimal setup. This section makes use of the pre-packaged [TTSystem ](https://llando.gitbook.io/ttsystem/components-prefabs/ttsystem)prefabs to automatically handle a lot of the process.

It uses terminology that describes adding time trials to racing games, but the implementation steps are largely the same for all genres. E.g: platformers, speedrunning, puzzle games etc.

Should you want more customizability when integrating into your own project, refer to the [Manual Setup](https://llando.gitbook.io/ttsystem/guides/manual-setup) guide.

This guide assumes that you have already imported the **Complete Time Trial System** package into your project.

{% hint style="info" %}
**NOTE:** The minimum 3 components needed to setup time trials are the [TrackManager](https://llando.gitbook.io/ttsystem/components-prefabs/trackmanager), [LapTimeTrackingObject ](https://llando.gitbook.io/ttsystem/components-prefabs/laptimetrackingobject)and the [TrackPoint ](https://llando.gitbook.io/ttsystem/components-prefabs/trackpoint)components. The quick setup guide uses a prefab that adds all of these automatically but it is still useful to be aware of.
{% endhint %}

### Video Guide:

{% embed url="<https://youtu.be/i-G_eIsxhAk>" %}

### Step-by-step:

* Add a [LapTimeTrackingObject](https://llando.gitbook.io/ttsystem/components-prefabs/laptimetrackingobject) component to any object(s) that you wish to track lap times of. The object that you add this component to **MUST** have a collider and rigidbody attached.
* Drag one of the two [TTSystem ](https://llando.gitbook.io/ttsystem/components-prefabs/ttsystem)prefabs found in **TTSystem > Prefabs** into your scene.&#x20;
  * If your [LapTimeTrackingObject ](https://llando.gitbook.io/ttsystem/components-prefabs/laptimetrackingobject)uses 2D colliders, use TTSystem2D prefab.
  * If your [LapTimeTrackingObject ](https://llando.gitbook.io/ttsystem/components-prefabs/laptimetrackingobject)uses 3D colliders, use TTSystem3D prefab.

{% hint style="warning" %}
**CAUTION:** Collider types of [LapTimeTrackingObject ](https://llando.gitbook.io/ttsystem/components-prefabs/laptimetrackingobject)and TrackPointPrefabs must match for OnTriggerEnter/OnTriggerEnter2D callbacks to be registered which is required to calculate lap times.
{% endhint %}

* Within the root [TTSystem ](https://llando.gitbook.io/ttsystem/components-prefabs/ttsystem)prefab there are five [TrackPointPrefabs ](https://llando.gitbook.io/ttsystem/components-prefabs/trackpoint)inside the ExampleTrack parent GameObject, either 2D or 3D depending on the [TTSystem ](https://llando.gitbook.io/ttsystem/components-prefabs/ttsystem)you selected. These are used as various points along your track - you can think of them as checkpoints.
  * Move the position of each [TrackPointPrefab ](https://llando.gitbook.io/ttsystem/components-prefabs/trackpoint)GameObject to positions along your track and in the correct order you want them to be passed in.
  * Adjust the dimensions of any [TrackPointPrefab ](https://llando.gitbook.io/ttsystem/components-prefabs/trackpoint)colliders if needs be so they fit your track.
* In the ExampleTrack GameObject, navigate to the [TrackManager ](https://llando.gitbook.io/ttsystem/components-prefabs/trackmanager)component and:
  * Set the TrackType parameter on the [TrackManager ](https://llando.gitbook.io/ttsystem/components-prefabs/trackmanager)to either linear or circular based on the layout of your track. (See [TrackManager](https://llando.gitbook.io/ttsystem/components-prefabs/trackmanager) for a breakdown of each type of track).
  * **(Optional)** Set the track name field to the name of your track.&#x20;
* **DONE!**

Complete a lap with your [LapTimeTrackingObject](https://llando.gitbook.io/ttsystem/components-prefabs/laptimetrackingobject). Time trial data will now be displayed on screen as part of the [TTSystem ](https://llando.gitbook.io/ttsystem/components-prefabs/ttsystem)in the [TimeTrialUIManager ](https://llando.gitbook.io/ttsystem/components-prefabs/timetrialuimanager)GameObject. This can be deleted/hidden if you do not want your time trial data on screen as all time trial data is still exposed on the [LapTimeTrackingObject ](https://llando.gitbook.io/ttsystem/components-prefabs/laptimetrackingobject)component.

Navigate to the [LapTimeTrackingObject ](https://llando.gitbook.io/ttsystem/components-prefabs/laptimetrackingobject)component while your game is running to see the time trial data in real-time without requiring any UI in your game. This is useful for debugging and is updated live as you complete the lap.&#x20;

### Modifying The TTSystem Prefab To Suit Your Track

You can add/remove [TrackPointPrefabs ](https://llando.gitbook.io/ttsystem/components-prefabs/trackpoint)as you need, but **ALWAYS** update the TrackPoints list in the [TrackManager ](https://llando.gitbook.io/ttsystem/components-prefabs/trackmanager)and populate the list in the order you want them to be passed as seen in ExampleTrack:

| TTSystem Hierarchy                                                                                                                                                                                                  | TrackManager Component on ExampleTrack                                                                                                                                                                                                                     |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ![](https://3733049803-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKSO40gSd5fO9KWfOWErW%2Fuploads%2FqBmIAgfWtZ0PpJL4vNiq%2Fimage.png?alt=media\&token=a01599de-f0b1-4e8d-9970-6dda774346ca) | <img src="https://3733049803-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKSO40gSd5fO9KWfOWErW%2Fuploads%2Few0ASKp2kuTkqDt2gKYV%2Fimage.png?alt=media&#x26;token=53212e3c-18a4-4ec4-8293-9456fecb4b48" alt="" data-size="original"> |

{% hint style="info" %}
**BEGINNER UNITY TIP:** You do not have to individually drag each GameObject into the inspector to populate a list:

* Make sure your [TrackPointPrefabs ](https://llando.gitbook.io/ttsystem/components-prefabs/trackpoint)are in order
* Lock the inspector with the [TrackManager ](https://llando.gitbook.io/ttsystem/components-prefabs/trackmanager)component visible
* Select the [TrackPointPrefabs ](https://llando.gitbook.io/ttsystem/components-prefabs/trackpoint)for that track
* Drag the entire selection into the list of TrackPoints to automatically populate it whilst maintaining the correct order.
  {% endhint %}

### What Next?

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

#### [How do I add time trials to multiple tracks?](https://llando.gitbook.io/ttsystem/guides/adding-new-tracks)
