How to make a sound occur at the same time UI pops up?

Hello,

I’m looking for any help on how I would make a sound play when my UI appears.
I’ve seen plenty of loading screens that have a pop sound play when the UI appears on screen.

If anyone knows how to do this please let me know!

Thanks, RTC

if you have a script for making it visible then just add a sound in the script and do:

script.Sound:Play()

or you could add a new script and do:

script.Parent:GetPropertyChangedSignal("Visible"):Connect(function()
   script.Sound:Play()
end)
2 Likes

I find your first solution to be the best suited for this scenario, but I’d like to make an addition to the second option you posted in case OP wants to use it instead:

script.Parent:GetPropertyChangedSignal("Visible"):Connect(function()
  -- Play only when the UI is visible.
  if(script.Parent.Visible) then   
    script.Sound:Play()
  end
end)

Cheers!

1 Like