Hi there, I have a club floor that changes colors to the music’s loudness. The issue is, is that colors don’t move smoothly and rather does this “flickering” effect when changing in between colors. I’ve tried using tween however it’s an absolute pain working with it. Also, since this is using renderstepped, it runs at 60 frames per second however I’ve also tried it at 144fps (as prior to an fps unlocker) and didn’t cause much of a difference.
local sound = workspace.Sound
local plr = game.Players.LocalPlayer
local parts = workspace:WaitForChild("parts")
local floor = parts:WaitForChild("Club Floor")
local pillars = workspace.pillar
local pillar1 = pillars.Model1.neon.Part
local pillar2 = pillars.Model2.neon.Part
local pillar3 = pillars.Model3.neon.Part
local pillar4 = pillars.Model4.neon.Part
local button = plr.PlayerGui:WaitForChild("Settings"):WaitForChild("GUI"):WaitForChild("panels"):WaitForChild("ScrollingFrame"):WaitForChild("Visualizers"):WaitForChild("Club Floor"):WaitForChild("button")
local on = true
local ColorSilent = Color3.fromRGB(0, 0, 0)
local ColorLoud = Color3.fromRGB(10, 162, 243)
local rs = game:GetService("RunService")
local lastSoundLevel = sound.PlaybackLoudness
button.Text = ("ON")
button.BackgroundColor3 = Color3.fromRGB(90,90,90)
rs.RenderStepped:Connect(function()
if on then
local difference = (sound.PlaybackLoudness / 2.2) - lastSoundLevel
difference /= 100
difference = math.clamp(difference,0.62,1)
local change = ColorSilent:Lerp(ColorLoud,difference)
floor.Color = change
pillar1.Color = change
pillar2.Color = change
pillar3.Color = change
pillar4.Color = change
end
end)