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.

1 comment

0

Looks like it should work, is this in a loop so it runs repeatedly?