Skip to main content

Track Sections Data Setup

danger

This tutorial is deprecated as a better written one can be found here

What is a TrackSectionsData?

TrackSectionsData defines how to affect physics for a train for each position on a track.

It is used primarily with the PhysicsSimulator api used in track-based physics. This includes roller coasters, but it can also be used for drop towers/tracks and omnimovers as well.

See the PhysicsSimulator API and the PhysicsSimulator tutorial for more information.

TrackSectionsData layout

  • DefaultTrackType
  • DefaultTypeSection
  • TypeSections

TypeSection Layout

  • Start
  • End
  • TrackType or
  • TrackTypes (for KeyframeTypeSections)

Overview

It looks something like:

Track Sections Data

  • DefaultTrackType and DefaultTypeSection
  • TypeSections

Defaults

  • DefaultTrackType and DefaultTypeSection
  • Used when Recorder cannot find a TrackType for a given section
    • "Defaults" to this value

Track Type

  • In coasters, our default is to "coast", or just move with Gravity and Friction
  • These defaults also make it so that you only need to set the sections which affect the physics instead of having to map every position.

TypeSections

Track Type

type TypeSection = {
Start: NumberValue,
End: NumberValue,
TrackType: Folder,
}

Getting Track Positions

danger

The Track Position plugin is still a work in progress.

There's a plan to make a TrackSectionsData editor in the future.

The plugin provides a built-in method for

Select the point using Alt + Click to scope into the Model without un-grouping it.

The position should should up in the UI.

Still a work in progress

Copy the position and set the Start or End value to that position.

Editing Type Section

Track Type

type TrackType = {
Type: IntValue,
Acceleration: NumberValue,
Deceleration: NumberValue,
Speed: NumberValue,
UseGravity: BoolValue,
UseFriction: BoolValue,
ClampToTargetSpeed: BoolValue,
}

Type

How this section will affect the train.

See MoveType for more detailed information.

enum MoveType = {
None = 0,
Accelerate = 1,
Decelerate = 2,
Transport = 3,
Constant = 4,
}

Acceleration

Accelerates the train.

This number is a multiple of gravity.

MUST be greater than or equal to zero

Deceleration

Decelerates the train.

This number is a multiple of gravity.

MUST be greater than or equal to zero

Speed

This is our target speed

UseGravity

Whether gravity will be applied

UseFriction

Whether friction will be applied

ClampToTargetSpeed

Clamps the speed so that, when it reaches this, it stay at this amount unless other forces such as gravity or friction overcome this.

KeyframeTypeSection

KeyframeTypeSection was created as a way to automatically change the TypeSection's TrackType the longer a train is in the section.

You can have it transition in-between TrackTypes using Easing functions.

Requires a Folder named TrackTypes

Track Type

Each child of TrackTypes must have:

  • Position: NumberValue
  • TrackType: Folder

TrackType contains the same data as used above with the "Single"TypeSection.

Position is the TimePosition