📪TrackManager
Component
Last updated
Component
Last updated
TrackManager is used to set and store properties according to the needs of your track. Each track in your project should have a TrackManager component to represent its layout.
The only properties that you MUST set on this component are the list of track points and the track type. The number of track points to add to your track is completely up to you, but should follow certain restrictions based on your track type.
The TrackType is an enum that changes how lap start and finishes are calculated. There are two options for the track type:
Circular - You should use this track type if your start and finish lines are the same place. A good example of a circular track would be racing circuits which feature multiple laps.
NOTE: A circular track uses the first track point in the list as both the start and finish line but should have extra track points around the track to validate the lap and prevent cheating.
Linear - You should use this track type if your start and end finish line are different positions in your game. For example, a race that goes from point A to B (even if it has checkpoints in between) would suit the linear TrackType.
NOTE: A linear track should have a minimum of two track points in the list for the start and finish lines. You can also add many more in between to be used as checkpoints.
This is a list of TrackPoint objects that any LapTimeTrackingObject must pass through in order to register a valid lap and get a lap time. All points must be passed for the lap to be valid.
CAUTION: The track points list cannot be empty. It must be populated in order to start and stop a lap time. See the TrackType section above to see how to fill the list based on your type of track.
Refer to the TrackPoint for more details.
The name of the track that this component is managing. Defaults to the name of the GameObject that this component is attached to if no track name is provided.