I was adding SFX to my VFX plugin when i noticed my sounds are not playing.
i searched and found out i have to use RunService:Run() (which starts physics simulation, runs scripts and disables undoing (ctrl + z))
it sounds stupid to me that you can’t play sounds without physics simulation & running scripts.
if security is a concern. make a PluginPermission for playing sounds.
Expected behavior
I expect plugins to be able to play sounds anywhere not just with SoundService and without the need of RunService:Run().
Also sounds under parts or attachments should work normally like they do in play-testing.
that will also allow developers to test spatial sounds by playing it from the command bar instead of going in and out of play-testing.
local Toolbar = plugin:CreateToolbar("Toolbar")
local PlayTheSound = Toolbar:CreateButton("b","Button","")
local Sound = script:FindFirstChild("Sound")
local DockWidgetGui = plugin:CreateDockWidgetPluginGui("SoundHolder",DockWidgetPluginGuiInfo.new(
Enum.InitialDockState.Left,
false,
false,
500,
500,
200,
200
)
)
Sound.Parent = DockWidgetGui
Sound:Stop()
PlayTheSound.Click:Connect(function()
if Sound.IsPlaying then
Sound:Stop()
else
Sound:Play()
end
end)
You don’t need any permission
Note:DockWidgetGui is just for holding sounds nothing else
Just make sure dockwidgetplugininfo is not Enabled and
InitialEnabled ,InitialEnabledShouldOverrideRestore must be false or it will randomly pop up DockWidgetPluginGui when starting