Adding New Tracks
Guide
Last updated
Guide
Last updated
Tracks are defined by their TrackManager component. Every track must have its own component to represent its layout.
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 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 component in that scene, and create the layout of your track as normal.
in :
To add multiple tracks in the same scene, simply modify the reference in 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 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 reference for individual at any point during gameplay.
For example, you could have 2 races going on simultaneously in the same Unity scene each making use of time trials for their own on each track.