Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can I make a audio fade-in & out smoothly?

Asked by 4 years ago

So I have been making a audio that would go from volume 1 to volume 0.

script.Parent.Sound.Volume= 0.99
script.Parent.Sound.Volume = 0.98

No one wants to do that

How can you make it do it smoothly and not over stress the system?

1 answer

Log in to vote
1
Answered by
Hydrogyn 155
4 years ago

Wow, this is something a loop could do!

Let's use a for loop!

local SoundObject = script.Parent.Sound
local MaxVolume = .5

for CurrentVolume = 0,MaxVolume*10,1 do 
    wait(.25)
    Object.Volume = MaxVolume - CurrentVolume*.01
end

This may or may not work, I haven't tested it, but it should work! :)

hydrogyn

Ad

Answer this question