Railroad Track

Parent

A peice of railroad track over which trains can drive.

Properties

isOwnedByPlatform : Bool

True if the track is part of/owned by a railroad platform.

Details
Flags ReadOnly RuntimeSync RuntimeParallel

Display Name

Is Owned By Platform

length : Float

The length of the track.

Details
Flags ReadOnly RuntimeSync RuntimeParallel

Display Name

Length

Functions

getClosestTrackPosition (worldPos : Struct<Vector>) → (track : Trace<RailroadTrack>, offset : Float, forward : Float)

Returns the closes track position from the given world position

Details

Flags

RuntimeSync RuntimeParallel MemberFunc

Display Name

Get Closeset Track Position

Parameters
Name Type Description

World Pos worldPos

Struct<Vector>

The world position form which you want to get the closest track position.

Return Values
Name Type Description

Track track

Trace<RailroadTrack>

The track the track pos points to.

Offset offset

Float

The offset of the track pos.

Forward forward

Float

The forward direction of the track pos. 1 = with the track direction, -1 = against the track direction

getConnection (direction : Int) → connection : Trace<RailroadTrackConnection>

Returns the railroad track connection at the given direction.

Details

Flags

RuntimeSync RuntimeParallel MemberFunc

Display Name

Get Connection

Parameters
Name Type Description

Direction direction

Int

The direction of which you want to get the connector from. 0 = front, 1 = back

Return Values
Name Type Description

Connection connection

Trace<RailroadTrackConnection>

The connection component in the given direction.

getTrackGraph () → track : Struct<TrackGraph>

Returns the track graph of which this track is part of.

Details

Flags

RuntimeSync RuntimeParallel MemberFunc

Display Name

Get Track Graph

Return Values
Name Type Description

Track track

Struct<TrackGraph>

The track graph of which this track is part of.

getVehicles () → vehicles : Array<Trace<RailroadVehicle>>

Returns a list of Railroad Vehicles on the Track

Details

Flags

RuntimeSync RuntimeParallel MemberFunc

Display Name

Get Vehicles

Return Values
Name Type Description

Vehicles vehicles

Array<Trace<RailroadVehicle>>

THe list of vehicles on the track.

getWorldLocAndRotAtPos (track : Trace<RailroadTrack>, offset : Float, forward : Float) → (location : Struct<Vector>, rotation : Struct<Vector>)

Returns the world location and world rotation of the track position from the given track position.

Details

Flags

RuntimeSync RuntimeParallel MemberFunc

Display Name

Get World Location And Rotation At Position

Parameters
Name Type Description

Track track

Trace<RailroadTrack>

The track the track pos points to.

Offset offset

Float

The offset of the track pos.

Forward forward

Float

The forward direction of the track pos. 1 = with the track direction, -1 = against the track direction

Return Values
Name Type Description

Location location

Struct<Vector>

The location at the given track position

Rotation rotation

Struct<Vector>

The rotation at the given track position (forward vector)

Signals

VehicleEnter (Trace<RailroadVehicle> Vehicle Vehicle)

Triggered when a vehicle enters the track.

Details
Parameters
Name Type Description

Vehicle Vehicle

Trace<RailroadVehicle>

The vehicle that entered the track.

VehicleExit (Trace<RailroadVehicle> Vehicle Vehicle)

Triggered when a vehicle exists the track.

Details
Parameters
Name Type Description

Vehicle Vehicle

Trace<RailroadVehicle>

The vehicle that exited the track.