Hi there, I have a script that lerps between two colors using playbackloudness. Issue is, is that it doesn’t lerp smoothly and doesn’t transition through enough colors. I do not have a current attempt as I do not understand why this is happening.
local sound = workspace.Sound
local parts = workspace:WaitForChild("parts")
local floor = parts:WaitForChild("Club Floor")
local ColorSilent = Color3.fromRGB(0, 0, 0)
local ColorLoud = Color3.fromRGB(10, 162, 243)
task.spawn(function()
while task.wait() do
local fractionAlpha = sound.PlaybackLoudness / 150
if fractionAlpha > 1 then
fractionAlpha = 1
end
floor.Color = ColorSilent:Lerp(ColorLoud, fractionAlpha)
print(sound.PlaybackLoudness)
end
end)
local sound = workspace:WaitForChild("Flushed")
sound:Play()
while task.wait() do
script.Parent.Color = script.Parent.Color:Lerp(Color3.fromRGB(math.clamp(sound.PlaybackLoudness / 2,10,255),0,0),math.clamp(sound.PlaybackLoudness,0.3,1))
end
I had to untick solution because now I’ve ran into another problem. Is there a way I can adjust the maxloudness of this? The loudness of the playbackloudness is a bit high.