Lesson 3

Table of Contents

Connecting Switches with Switch Containers

You’ve just imported four sets of ground material sounds, yet there are nine possible materials defined within the game, so you’ll have to use the same sounds for several different surfaces that the characters walk on. Making these assignments is accomplished within the Switch Container you just created, first, by associating the Switch Container with a particular Switch Group. As you further develop the audio for the game, you could end up with many Switch Groups for other purposes, but only one Switch Group can be associated with a particular Switch Container. You assign a Switch Group to a Switch Container within the Switch Container’s Property Editor.

  1. With the Footsteps object selected, in the Property Editor, click the Group [>>] selector and choose Switch Groups > Material.

    Now the Footsteps Switch Container is aware of the possible surfaces the player may be on. If for some reason the game engine doesn’t communicate a surface to the audio engine, you need to define a default surface that should be used, such as Concrete.

  2. Click the Default Switch/State [>>] selector and choose Concrete.

    The Assigned Objects area is now populated with the Switch objects you created in the last exercise.

    In the Footsteps Contents Editor, the Random Containers representing the sounds you just imported are shown on the left, while the list of Switch objects indicating the actual surfaces the player is on are shown on the right. To assign a sound to a particular surface, you simply drag the object from the left column to the destination surface on the right.

    This is where you need to think about which sounds you have available and what makes the most sense for the surfaces that occur in the game. Some associations are obvious, such as Concrete sounds should go to the concrete surface; however, others may not be ideal. For example, which of the four types of sounds you imported would work for water? At this point, none of them, but for now you assign a placeholder. Later, when you can record yourself walking on water, you can update the water surface with a better sound. Using this approach, as long as you have all of the potential surfaces accounted for, you won’t have to go back and bother a programmer when you want to change the sounds at a later time.

  3. In the Footsteps Contents Editor, drag the Concrete Random Container object to the Concrete Switch in the Assigned Objects area.

  4. Drag the Dirt Random Container object to the Grass Switch and continue to assign them until all have an associated object.


    If you select the Random Container in the left column, it will be assigned to the Transport Control so you can quickly audition the sound before deciding which surfaces it should be assigned to.


    It is possible to assign more than one object to the same surface in which case both would play simultaneously when the player is walking on that surface.

Was this page helpful?