Sound¶
Inherits Dynamic
Sounds are objects that can be placed in the world and play audio.
Properties¶
Audio : AudioAsset¶
The audio asset to be played by the sound.
Volume : number¶
The volume level of the sound.
Pitch : number¶
The pitch level of the sound.
Autoplay : boolean¶
Determines whether the sound should start playing automatically when loaded.
Loop : boolean¶
Determines whether the sound should loop when it reaches the end.
PlayInWorld : boolean¶
Determines whether the sound should be played in the 3D world space.
MaxDistance : number¶
The maximum distance at which the sound can be heard.
Time : number¶
Indicates the current playback position of the sound in seconds.
Playing : boolean¶
Indicates whether the sound is currently playing.
Loading : boolean¶
Indicates whether the sound is currently loading.
Length : number¶
The total length of the sound in seconds.
Methods¶
Play → nil¶
Parameters: ``
Starts playing the sound.
PlayOneShot → nil¶
Parameters: volume [ number? ]
Plays the sound once at the specified volume without affecting the current playback.
Stop → nil¶
Parameters: ``
Stops the sound if it is currently playing.
Events¶
Loaded¶
Parameters: ``
Fires when this sound has loaded