Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Attempting to Trigger Blur effect with Music?

Is there any way I could change the blur intensity with music. For example, the blur increases with the beat of a song. Exactly like this roblox game: https://www.roblox.com/games/2117000638/rockefeller-street

7 comments

0

I think in the example game they have made the blur effect manually

0

So i couldn't do it with the Roblox Blur?

0

If they do this manually it means that they made sure to make the game repeat on a loop where the effect occurs based on the time position of the audio

0

So I would have to create my own blur?

0

Sounds have a PlaybackLoudness property that ranges  between 0 and 1000 depending on the volume of the sound the instance the property was read. You can use this in conjunction with a loop so you can read the property then setting the blur based on it.

0

It doesn't return; it's not a function

0

Fixed

1 answer

PlaybackLoudness is a Property of Sound Instances, which can range from 0 to 1000

Size is a Property of the "Blur" used in Roblox Lighting with ranges from 0 to 56

Since PlaybackLoudness uses the audio sound volume input, you need to use a LocalScript, since playing the sound on the Server would result in only getting the number 0 (no microphone)

LocalScript

local blur = game:GetService("Lighting"):WaitForChild("Blur")
local sound = script:WaitForChild("Sound")
sound.Looped = true
sound:Play()

while true do
	blur.Size = (sound.PlaybackLoudness / 1000) * 56
	wait()
end

The math is simply taking the percent of PlaybackLoudness and multiplying by the max limit of the blur size.

In this case, I added a LocalScript under StarterGui with the Sound under the script

6 comments

0

Thank you!

0

why

0

o.o ^

1
0

this didnt even work but ok sissss

0

In order for this to work, you need to have a blur in lighting

This discussion is preserved as it was. New answers, comments, and votes are closed.