hey everyone,
i’m working on a script where a part spins based on how loud a sound is (using PlaybackLoudness), but it’s not really working the way i expected.
the idea is that the louder the sound, the faster the part should spin. the spinning itself works, but the speed doesn’t seem to change with the loudness. i’m not sure if i’m reading the right PlaybackLoudness, or if i’m even using it correctly — especially since i’m trying this with a Humanoid.
can anyone help me figure out what might be wrong with my logic or suggest what i could try instead?
local speed = -90
local angle = 0
game:GetService("RunService").Heartbeat:Connect(function(dt)
angle = (angle + speed * dt) % 360
attachment.Orientation = Vector3.new(0, angle, 0)
end)
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local baseSpeed = speed
humanoid:GetPropertyChangedSignal("PlaybackLoudness"):Connect(function()
local loudness = humanoid.PlaybackLoudness
local speedMultiplier = math.clamp(loudness / 50, 0.5, 3)
speed = baseSpeed * speedMultiplier
end)```
i’m mainly just trying to understand how to properly use PlaybackLoudness and make sure i’m getting it from the right object. go easy on me, i’m still learning and i am dumb 

** You are now Level 3! **