Radio Scaling w/ PlaybackLoudness

Im trying to make a radio mesh scale based on the music’s PlaybackLoudness.
I need minimum value of Vector3(1,1,1) and a maximum value of Vector3(1.3,1.3,1.3), but I don’t know how to go about this.

Current Code

game:GetService("RunService").RenderStepped:Connect(function()
	
	local loud = Audio.PlaybackLoudness * .100
	print(loud)
	local radio = player.Radio.Mesh

	if radio then
		radio.Scale = Vector3.new(loud, loud, loud)
	end

end)
1 Like

Max playback loudness is 1000 so loud would be 1000 / 1000 * 0.3 = 0.3 when the audio is as loud as roblox allows. Then you just add this loudness to the default size you want, Vector3.new(1, 1, 1). I’m pretty sure you can also do radio.Scale = Vector3.new(1, 1, 1) * (loud + 1)

local loud = Audio.PlaybackLoudness / 1000 * 0.3
radio.Scale = Vector3.new(1 + loud, 1 + loud, 1 + loud)
2 Likes

Wow, that works exactly how I wanted :grin:

Thanks <3

1 Like