📪Quick Setup
Guide
Last updated
Guide
Last updated
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 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 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 TrackManager, LapTimeTrackingObject and the TrackPoint components. The quick setup guide uses a prefab that adds all of these automatically but it is still useful to be aware of.
Add a 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 prefabs found in TTSystem > Prefabs into your scene.
If your LapTimeTrackingObject uses 2D colliders, use TTSystem2D prefab.
If your LapTimeTrackingObject uses 3D colliders, use TTSystem3D prefab.
CAUTION: Collider types of LapTimeTrackingObject and TrackPointPrefabs must match for OnTriggerEnter/OnTriggerEnter2D callbacks to be registered which is required to calculate lap times.
Within the root TTSystem prefab there are five TrackPointPrefabs inside the ExampleTrack parent GameObject, either 2D or 3D depending on the 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 GameObject to positions along your track and in the correct order you want them to be passed in.
Adjust the dimensions of any TrackPointPrefab colliders if needs be so they fit your track.
In the ExampleTrack GameObject, navigate to the TrackManager component and:
Set the TrackType parameter on the TrackManager to either linear or circular based on the layout of your track. (See TrackManager for a breakdown of each type of track).
(Optional) Set the track name field to the name of your track.
DONE!
Complete a lap with your LapTimeTrackingObject. Time trial data will now be displayed on screen as part of the TTSystem in the 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 component.
Navigate to the 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.
You can add/remove TrackPointPrefabs as you need, but ALWAYS update the TrackPoints list in the TrackManager and populate the list in the order you want them to be passed as seen in ExampleTrack:
BEGINNER UNITY TIP: You do not have to individually drag each GameObject into the inspector to populate a list:
Make sure your TrackPointPrefabs are in order
Lock the inspector with the TrackManager component visible
Select the TrackPointPrefabs for that track
Drag the entire selection into the list of TrackPoints to automatically populate it whilst maintaining the correct order.
TTSystem Hierarchy | TrackManager Component on ExampleTrack |
---|---|