Skip to content
WhistleWiz edited this page Apr 14, 2024 · 4 revisions

Base audio

CCL will automatically add the basic audio to your car (wheels, brakes, collisions...).

Locomotives will also include those sounds automatically.

Locomotive audio

For locomotives (slugs included), you will need to create an audio prefab. Each child of this prefab should be for 1 sound.

Clips

Clips are single use sounds that happen on certain events. For these, you use an AudioClipPortReader component. You can use all clips together on the same GameObject.

Examples of usage are:

  • Turning off a diesel engine
  • Contactors changing on the TMs
  • Compressor finished charging reservoirs

Layered Audio

These are used for any sounds that are constantly affected by ports.

Layers

Layered audio uses layers for complex output. The DE2's engine at idle has 3 layers, the engine itself, the shaft, and the compressor's whine.

Each layer has its own audio source. Position them where you want the sound to come from.

Dopler

Each sound source you want affected by the doppler effect needs to have a component named DopplerProxy.

LayeredAudioPortReaderProxy

To actually affect the LayeredAudioProxy component, you'll need LayeredAudioPortReaderProxy components on the same object. Multiple can affect the same audio.

Clone this wiki locally