# Utilizing Time Trial Data Effectively

This section covers how to effectively utilize the data that **Complete Time Trial System** provides. There are 2 main ways this can be done in which this guide covers both.

You can either:

* Use the built-in Unity Events provided by the LapTimeTrackingObject in the inspector to run your own logic based on time trial events
* Access LapTimeTrackingObject data directly through the provided read-only public properties to use in your own logic&#x20;

### Running Your Own Logic Based On Time Trial Events:

**Complete Time Trial System** (as of version 1.1.0) now provides Unity Events in the inspector of any LapTimeTrackingObject to apply your own logic based on time trial events that occur. These make extending the time trial system much simpler to add your own functionality. The provided events are:

* OnTimerStarted()  - Called when the time trial timer has started. This happens when the LapTimeTrackingObject has passed the first point.

* OnValidLapCompleted() – Called when a valid lap has been completed by the LapTimeTrackingObject. This means that all points in the TrackManager have been passed and no cheating was detected.

* OnSectorPassed()  - Called when a sector has been passed. This means a distance from one point to another.

* OnNewBestLapTime()  - Called when a new best lap time has been achieved. Mainly useful in combination with the TimeTrialSaveManager or when using your own method of storing lap times.

<figure><img src="/files/cYXgx2jN0Bpj9ZTmhMxG" alt="" width="315"><figcaption></figcaption></figure>

### Running Your Own Logic Based On Time Trial Events:

As of version 1.1.0, **Complete Time Trial System** now provides easier access to important time trial data through the LapTimeTrackingObject. This is done through read only public properties that allow you to access time trial values for your own purposes. These are:

* **BestLapTime** – Raw best lap time value of type double
* **BestLapTimeConverted** – Best lap time converted to a clean string representation with time formatting
* **CurrentLapTime** – Raw current lap time value of type double
* **CurrentLapTimeConverted** – Current lap time converted to a clean string representation with time formatting

### 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)

#### [How do I add time trials to multiple tracks?](/ttsystem/guides/adding-new-tracks.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://llando.gitbook.io/ttsystem/guides/utilizing-time-trial-data-effectively.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
