Hi there, I have a script that uses tween and playbackloudness to change the color of a part. The issue here is that the color changes more like a metronome and doesn’t actually correspond to the loudness of the music, rather the beat. I want to achieve so that instead, so it’s a lot faster and responsive with the music (basically the sensitivity of it). I have tried changing the different values inside the script however none appeal to my request.
Script below:
local sound = workspace:WaitForChild("Sound")
local part = workspace.parts["Club Floor"]
local TweenService = game:GetService("TweenService")
local TweeningInformation = TweenInfo.new(
2,
Enum.EasingStyle.Quad,
Enum.EasingDirection.Out,
753475938457843579348573,
true,
0
)
local PartProperties = {
Color = Color3.fromRGB(sound.PlaybackLoudness, 84, 185)
}
local Tween = TweenService:Create(part,TweeningInformation,PartProperties)
Tween:Play()
I think I found the problem, I just opened studio and tested a little script:
print(script.Parent.Name .. " loaded!")
local part = workspace.Part
wait(10)
local TweenService = game:GetService("TweenService")
local info = TweenInfo.new(2, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut, 0, false, 0)
local tween = TweenService:Create(part, info, {
Color = Color3.fromRGB(255, 0, 255)
})
tween:Play()
Problems I found in your TweenInfo:
You seem to have set the repeat count of your tween to 753475938457843579348573.
And you have the reverseTween boolean set to true as well.
local sound = workspace:WaitForChild("Sound")
local part = workspace.parts["Club Floor"]
local TweenService = game:GetService("TweenService")
local TweeningInformation = TweenInfo.new(
2,
Enum.EasingStyle.Quad,
Enum.EasingDirection.Out,
753475938457843579348573,
true,
0
)
local function getRand()
return math.round(sound.PlaybackLoudness/math.random(0, 255))
end
local PartProperties = {
Color = Color3.fromRGB(getRand(), getRand(), getRand())
}
local Tween = TweenService:Create(part,TweeningInformation,PartProperties)
Tween:Play()
Oh I noticed you from my other post. Would it have to be randomised though? In one of my other topics, a guy did something a bit different where it worked, but it was stuck to just tweening through red (I couldn’t change that color otherwise I got a clamp error)