How to make audio fade in and out inside a loop, inside a loop?
Asked by
4 years ago Edited 4 years ago
I've tried using this script.
03 | if game.Lighting.ClockTime > = 19 then |
04 | for i = 0 , 0.08 , 0.01 do |
05 | workspace.Hoot.Volume = i |
06 | workspace.Crickets.Volume = i |
07 | workspace.Birds.Volume = -i |
10 | for i = 0 , 0.1 , 0.01 do |
11 | workspace.Wind.Volume = -i |
14 | elseif game.Lighting.ClockTime > = 6 then |
15 | for i = 0 , 0.08 , 0.01 do |
16 | workspace.Hoot.Volume = -i |
17 | workspace.Crickets.Volume = -i |
18 | workspace.Birds.Volume = i |
21 | for i = 0 , 0.1 , 0.01 do |
22 | workspace.Wind.Volume = i |
As you can see, the fade in and out part is a loop itself inside a loop. Using this method,
the audio fades in and out every second. My intention is for the audio to fade once every time day or night comes. Is there a better method to dong to