llando
  • Overview
    • 💡Introduction
    • ✨Feature List
  • Guides
    • 📪Quick Setup
    • 📪Manual Setup
    • 📪Utilizing Time Trial Data Effectively
    • 📪Adding Time Trial UI
    • 📪Adding Time Trial Saves
    • 📪Accessing Time Trial Data
    • 📪Adding New Tracks
  • Components/Prefabs
    • 📪TrackManager
    • 📪LapTimeTrackingObject
    • 📪TrackPoint
    • 📪TimeTrialUIManager
    • 📪TimeTrialSaveManager
    • 📪TTSystem
  • Internal Classes
    • 📪Sector
    • 📪LapTimeTrackingEditor
Powered by GitBook
On this page
  • Video Guide:
  • Step-by-step:
  • Modifying The TTSystem Prefab To Suit Your Track
  • What Next?
  1. Guides

Quick Setup

Guide

Last updated 1 month ago

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 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 guide.

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

NOTE: The minimum 3 components needed to setup time trials are the , and the components. The quick setup guide uses a prefab that adds all of these automatically but it is still useful to be aware of.

Video Guide:

Step-by-step:

    • (Optional) Set the track name field to the name of your track.

  • DONE!

Modifying The TTSystem Prefab To Suit Your Track

TTSystem Hierarchy
TrackManager Component on ExampleTrack

BEGINNER UNITY TIP: You do not have to individually drag each GameObject into the inspector to populate a list:

  • Drag the entire selection into the list of TrackPoints to automatically populate it whilst maintaining the correct order.

What Next?

Add a 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 prefabs found in TTSystem > Prefabs into your scene.

If your uses 2D colliders, use TTSystem2D prefab.

If your uses 3D colliders, use TTSystem3D prefab.

CAUTION: Collider types of and TrackPointPrefabs must match for OnTriggerEnter/OnTriggerEnter2D callbacks to be registered which is required to calculate lap times.

Within the root prefab there are five inside the ExampleTrack parent GameObject, either 2D or 3D depending on the you selected. These are used as various points along your track - you can think of them as checkpoints.

Move the position of each GameObject to positions along your track and in the correct order you want them to be passed in.

Adjust the dimensions of any colliders if needs be so they fit your track.

In the ExampleTrack GameObject, navigate to the component and:

Set the TrackType parameter on the to either linear or circular based on the layout of your track. (See for a breakdown of each type of track).

Complete a lap with your . Time trial data will now be displayed on screen as part of the in the 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 component.

Navigate to the 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.

You can add/remove as you need, but ALWAYS update the TrackPoints list in the and populate the list in the order you want them to be passed as seen in ExampleTrack:

Make sure your are in order

Lock the inspector with the component visible

Select the for that track

📪
LapTimeTrackingObject
TTSystem
LapTimeTrackingObject
LapTimeTrackingObject
LapTimeTrackingObject
TTSystem
TrackPointPrefabs
TTSystem
TrackPointPrefab
TrackPointPrefab
TrackManager
TrackManager
TrackManager
LapTimeTrackingObject
TTSystem
TimeTrialUIManager
LapTimeTrackingObject
LapTimeTrackingObject
TrackPointPrefabs
TrackManager
TrackPointPrefabs
TrackManager
TrackPointPrefabs
How do I make time trial data save across game sessions?
How do I add time trials to multiple tracks?
TTSystem
Manual Setup
TrackManager
LapTimeTrackingObject
TrackPoint