Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do i fade audio out smoothly?

I really want to fade my audio smoothly but i dont know how. Any help?

1 comment

2

Use a for loop

1 answer

As XXahraternotXX said in the comments, use a for loop to loop the audio volume down.

Here's an example,

local sound = script.Parent
sound.Volume = 1
sound:Play()

for i = 1,0,-0.03 do
	wait()
	sound.Volume = i
end

sound:Stop()

To make it fade faster or slower, change the number at the end of the i = thing. I used 0.03.

2 comments

4

The 0.03 should be negative. You're counting up, not down.

0

Oops, forgot.

This discussion is preserved as it was. New answers, comments, and votes are closed.