Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make the screen bounce to audio?

Asked by 6 years ago

So I was trying to make it so if I play a song, the fov would change from the playback loudness. This is what I have.

local Client = {
ScreenShakeSettings = {
        CameraMinFOV = 72,
        CameraMaxFOV = 70,
        CameraMaxVolume = 1000
}
}

local Settings = Client.ScreenShakeSettings
local SoundObject = workspace.GLOBAL_SOUND
local CurrentLoudness = SoundObject.PlaybackLoudness
local FOV = Settings.CameraMinFOV + (Settings.CameraMaxFOV - Settings.CameraMinFOV) * (CurrentLoudness / Settings.CameraMaxVolume)
if FOV > 0 and FOV < 120 then
    workspace.CurrentCamera.FieldOfView = FOV
end

Could anyone help me? Thanks.

0
Looks like it should work, is this in a loop so it runs repeatedly? justoboy13 153 — 6y

Answer this question