Playing a sound on a ShapeBase object
All ShapeBase
class objects are able to play up to four simultaneous sounds that track position of the object. In this recipe, we will learn how to
play and stop sounds on a ShapeBase
object.
Getting ready
We will be issuing console commands in a project based on the Torque 3D's FPS Tutorial
template, and try them out using the China Town Day
level. If you haven't already, use the Torque Project Manager (Project Manager.exe
) to create a new project from the FPS Tutorial
template; it can be found under the My Projects
directory.
Subsequently, start the game and load the China Town Day
level. You may want to change settings of the level just prior to playing to make sure we don't change levels while experimenting. Set the Time Limit to Infinite
and uncheck the Map Cycle setting.
How to do it...
In the following steps, we will make a
ShapeBase
object in the level play different sound effects:
After the
China Town Day
level starts, run the player over to the...