Trains - Parkitect/ParkitectAssetEditor GitHub Wiki

Custom trains for most of the tracked rides in the game.
The Resources/Reference Objects/Tracks folder contains reference track segments for most coaster types that you can use for scale reference, especially for determining where the car wheels should go. Note that the collision bounds, tunnel sizes and slope/curve radius of tracked rides depend on the ride type, not on the type of trains used by that ride, so generally it would be a good idea to keep your custom trains roughly within the same dimensions as the default trains used by that ride (otherwise your trains could clip through collision bounds/tunnels etc.).

Color settings

Check this page for more info on custom color settings.

Car model

You can use a different car model for the front of the train than for the remaining cars.

The pivot of your car should be centered between the front wheels and vertically aligned with the spot where the wheels will touch the surface of the track:

pivot

There needs to be an empty transform named "backAxis", positioned in the same way as the cars pivot but in the location of the back wheels:

backAxis

To make the wheels steer in curves split them into a separate part named "WheelsFront" or "WheelsBack" respectively.
The wheels are not very clearly visible on some types of coasters or the curve radius of the track might be so wide that it's not really noticeable whether the wheels are steering or not. In this case you shouldn't split the wheels into a separate part.

wheels

Car settings

Seat waypoint offset: defines a point that is offset by the given distance from the seat locations of the train. It is shown as a red sphere in the asset preview. Guests will walk up to this spot when entering the car, so you should move this to a spot where they won't clip through the car model too badly when entering.

seatWaypointOffset

Offset front/Offset back: a distance relative to the pivot/backAxis marker of the car to determine where the car ends, used for collision detection with other trains and to determine where to position the next car in the train. Shown as white lines with a "Front"/"Back" label in the preview. Move them roughly to the ends of the car model.

offsets

Seats

It's probably easiest to create seat markers in your modeling tool - simply create empty transforms named "Seat". Alternatively you can also add them in Unity.

Restraints

The restraints need to be opened by default in your car model and split into a separate part. The restraint pivots needs to be placed such that the restraint can rotate around its local X-Axis.
Configure the angle at which the closed restraint should be positioned by adjusting the Closed angle property. You'll see a preview of all affected restraints to assist you with determining the correct value for this property.

restraints

Car Type

You can choose between 3 different car types: Normal (just a regular car that does nothing special), Spinning (a car that can spin freely depending on G-forces) and Swinging (a car that swings when going around curves, depending on G-forces).
Depending on the car type the car needs to be set up in a certain way and there are additional settings available.

Spinning

Your car needs to have a transform called "spinAxis" somewhere in its hierarchy. Everything attached to that transform will be spinning freely around the local Y axis of that transform.
spinning

Spin friction: this value determines how fast the spinning slows down, with 0 = never and 1 = immediately

Spin strength: this controls how much of an effect G-forces have on the spinning

Spin symmetry sides: for some spinning cars there are multiple possible entrances/exits into the car that guests can take. If guests can enter/leave your car from 2 sides then leave the value at 2.

Swinging

Your car needs to have a transform called "swingAxis" somewhere in its hierarchy. Everything attached to that transform will be swinging freely around the local Z axis of that transform.
swinging

Swing friction: this value determines how fast the swinging slows down, with 0 = never and 1 = immediately

Swing strength: this controls how much of an effect G-forces have on the swinging

Max swing angle: this determines how far to each side the car can swing before getting stopped hard

Swing arm length: this determines how quick the pendulum movement is, with higher values = slower pendulum movement and lower values = faster pendulum movement

Dark Ride cars

For dark ride cars (or other rides that can face a certain direction defined by the track), you can use the Normal car type and set up a transform called "spinAxis" somewhere in its hierarchy (just like with the Spinning cars). Everything attached to that transform will be spinning around the local Y axis of that transform to face the direction defined by the track.

Animated Cars

For some types of cars you might want to use an animation that's more detailed than just spinning the cars wheels (i.e. for a miniature railway you might want to animate some pistons). For this you need to put an Animator component on the car. Give the animator an Animator Controller that has your cars animation. Add a float parameter called TrainSpeed to the animator controller and use it as speed multiplier for the animation state. Your animation should be timed such that the train in your animation moves at a speed of one unit per second. If this isn't possible (due to also having to loop seamlessly) you could alternatively make a one second long animation where the wheels turn once and then set the speed in the animator to 1.0 / wheel circumference.

animparam

Additionally there's some triggers that you can put on your animator controller to play special animations on certain events:

  • TrainOnEnteringStation
  • TrainOnWaitingForPassengers
  • TrainOnLeavingStation
  • TrainOnDriving
  • CarOnEnteringBlockBrake
  • CarOnLeavingBlockBrake