Playing a quick 2D or 3D sound on all clients
Torque 3D allows the game developer to broadcast either a 2D or 3D sound event to all clients connected to a server during gameplay. This is true even during a single-player game as Torque 3D internally still has a client/server environment.
In this recipe, we will learn the TorqueScript commands to issue sound events and discover their limitations.
Getting ready
We will be using a project based on the Torque 3D's Full
template and issuing console commands using the Empty Terrain
level. If you haven't already, use the Torque Project Manager (Project Manager.exe
) to create a new project from the Full
template. It will be found under the My Projects
directory. Then start up our new Full
template game and load the
Empty Terrain
level.
How to do it...
In the following steps we will trigger 2D and 3D sounds that play on all clients:
Open the console using the tilde (~) key and enter the following at the bottom of the screen to play a 2D sound on all...