Skip to content

Pathmover

The Pathmover is the basic component for moving MUs along a path based on Lines and Curves. The Pathmover component must be on the same Game Object level as the MUs and Source script.

The Pathmover is keeping its distance to the other Pathmovers by drawing 3 Raycasts. One straight on and two to the sides. As soon as the Distance (Distance / Distance Sides) is fallen below the defined values, the Pathmover starts to slow down (if the Drive has a defined acceleration) or stops immediately. As soon as the Distance is above, the Pathmover starts to speed up again.

Create On Path
Defines the Path where the Pathmover should be created by the Source.

Leave Path
If set to true the Pathmover will leave the path whenn reaching the end of a path with no successors. The MU (Transportable) will be totally under control of Physics.

Align with Path
Aligns the Pathmover with the Paths tangent if true.

Distance
The distance in meters, the pathmover keeps for the straight raycast

Distance Sides
The distance in meters, the pathmover keeps for the side raycasts

Angle Side
The angle of the side raycat.
Angle Side

Draw Ray

Align Vector
The vector of the Pathmover which should be aligned with the Path.

Current Station
The current station of the Pathmover. The station is assigned when entering and deleted when leaving the station

Current Station Working
The current working station, the value is set as soon as the working time starts in a station

Is Stopping
true, when the Pathmover is slowing down.

Is Starting
true, when the Pathmover is speeding up.

Is Stopped
true, when the Pathmover is stopped (e.g. at the end of a path or in a station)

Is Blocked
true, when the Pathmover is blocked (e.g. by another Pathover ahead)

Is On Path End
true, when the Pathmover is on an end of a Path.

Path
The current Path.

Position
The current position in meters on the Path.

The Pathmover has several events and you can assign your custom code to these events.

OnPathEntered (SimulationPath, PathMover)
Event is fired when a new Path is entered by Pathmover.

OnPathEnd (SimulationPath, PathMover)
Event is fired when a Pathmover is at the end of a Path.

OnPathExit (SimulationPath, PathMover)
Pathmover is leaving the Path.

OnStopping (SimulationPath, PathMover)
Pathmover is starting to stop (slowing down).

OnStopped (SimulationPath, PathMover)
Pathmover is fully stopped.

OnStart (SimulationPath, PathMover)
Pathmover is starting (speeding up).

OnFullyStarted (SimulationPath, PathMover)
Pathmover is at full speed.

OnBlocked (SimulationPath, PathMover)
Pathmover is blocked.

OnStationEntered (BaseStation, PathMover)
Pathmover has entered a Station.

OnStationWorkStarting(BaseStation, PathMover)
Pathmover has started the work in a Station.

OnStationWorkFinished(BaseStation, PathMover)
Pathmover has finished work in a Station.

OnStationExit(BaseStation, PathMover)
Pathmiver has left a Station.