学习
引擎类
SoundGroup

*此内容使用人工智能(Beta)翻译,可能包含错误。若要查看英文页面,请点按 此处


概要
继承成员

API 参考
属性
Volume
读取并联
功能: LegacySound
SoundGroup.Volume:number
代码示例
声音组
local SoundService = game:GetService("SoundService")
-- 创建一个声音组
local soundGroup = Instance.new("SoundGroup")
soundGroup.Parent = SoundService
-- 创建一个声音
local sound = Instance.new("Sound")
sound.SoundId = "rbxassetid://9120386436"
sound.Looped = true
sound.PlaybackSpeed = 2
sound.SoundGroup = soundGroup
sound.Parent = workspace
-- 播放声音
sound:Play()
task.wait(10)
-- 改变音量
soundGroup.Volume = 0.1
task.wait(3)
-- 返回音量
soundGroup.Volume = 0.5
task.wait(4)
-- 添加声音效果
local reverb = Instance.new("ReverbSoundEffect")
reverb.Parent = soundGroup

©2026 Roblox Corporation、Roblox、Roblox 标志及 Powering Imagination 是我们在美国及其他国家或地区的注册与未注册商标。