πŸ“ͺTrackManager

Component

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.

TrackType

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.

Track Points

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.

Refer to the TrackPoint for more details.

Track Name

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.

Last updated