PlaySoundOnce(string soundObjectName1, string soundObjectName2, ..., string soundObjectNameN)
This function plays ambient and 3D sounds soundObjectName1, soundObjectName2, …, soundObjectNameN once.
soundObjectName1, soundObjectName2, …, soundObjectNameN
Specify the name of the ambient and 3D sounds that should be played once by this function. You can also use the name “this” for soundObjectName[N]. In this case, “this” refers to the ambient or 3D sound that this script is attached to.
function Init() PlaySoundOnce("this", "river") end function Update() end
Assume that the above script is attached to an ambient sound named “ambient1”. Also, “river” in the example above is the name of a 3D sound. In our example, PlaySoundOnce function plays the current sound (which has a name equivalent to “ambient1”), and the 3D sound “river” once.PlaySoundOnce