Skip to main content

func_tracktrain

func_tracktrain icon
Brush entity

A func_tracktrain is a train that players drive along a track of path_track entities from a func_traincontrols on it, or that moves by itself at its Initial speed. It turns and tilts with the track.

Attributes​

The entity also has these common keys:

KeyDescriptionDefault
Nametargetname

Triggering the entity starts or stops the train. See Common keys.

First stop targettarget

Names the first path_track, where the train starts.

Soundsounds

Picks the rail sound the train loops while it moves, which goes up in pitch as the train goes faster, and Custom move sound replaces it. With None and no custom move sound, the train plays no move, start or brake sound.

  • None (0)
  • Rail 1 (1)
  • Rail 2 (2)
  • Rail 3 (3)
  • Rail 4 (4)
  • Rail 6 (5)
  • Rail 7 (6)
Default None (0)
Distance between the wheelswheels

Sets the distance between the front and the back wheels of the train, in units, and the train looks this far ahead on the track to turn and tilt along it.

If you leave this key empty or set 0, a moving train looks 100 units ahead, but where it starts, it isn't turned along the track.

Default 50
Height above trackheight

Sets how high the origin of the train rides above the path_track points, in units.

If you leave this key empty, it is 0 and the origin rides on the path.

Default 4
Initial speedstartspeed

Sets the speed the train has when the map starts, in units per second, and 0 means it stands still.

Default 0
Speedspeed

Sets the top speed of the train, in units per second, and 0 means 100.

Default 64
Damage on crushdmg

Sets the damage dealt each frame to anything that blocks the train, and the speed the blocker is pushed away at. Riders aren't hurt, and 0 deals no damage.

Default 0
Volumevolume

Sets how loud the sounds of the train are, from 1 for quiet up to 10 for full volume, and 0 means 10. For no sound, set Sound to None.

Default 10
Bank angle on turnsbank

Sets how far the train leans into turns, in degrees.

Default 0
Sound radiusFeaturefulsoundradius

Sets how far the move, start and brake sounds carry.

  • Small (-2) - Up to about 500 units away
  • Medium (-1) - Up to about 800 units away
  • Default (0) - Up to about 1250 units away
  • Huge (1) - Up to about 2000 units away
  • Enormous (2) - Up to about 4000 units away
  • Play Everywhere (3) - Anywhere on the map, and the sounds are as loud far away as close by
Default Default (0)
Custom move soundFeaturefulcustommovesnd

Sets a sound file played instead of the Sound choice, with the pitch set by the speed.

Custom brake soundFeaturefulcustomstopsnd

Sets the sound file of the brake.

If you leave this key empty, it is plats/ttrain_brake1.wav.

Flags​

1No Pitch

The train doesn't tilt up and down with the track, so it stays level

2No User Control

Players can't drive the train

4Forwards Only

Players can only drive the train forward, not in reverse

8Passable

Players and objects pass through the train

Notes​

See also​

Changes since 1.38​

  • You can use the new keys Sound radius, Custom move sound and Custom brake sound