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

I am trying to make the Screen bounce to the beat of the music but how do I do it?

Asked by 4 years ago
Edited 4 years ago

I have tried doing a script but I haven't been successful any of the times I tried. l

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
0
Can you post the script? Farsalis 369 — 4y
0
Yep Nistrict 44 — 4y

2 answers

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

So, there's two soups: The scripting-friendly one, and the audio-software friendly one.

I recommend the first unless you're up for a slight challenge, so I'll detail it below: Use PlaybackLoudness.

PlaybackLoudness tells you how "loud" a sound is being at a given timeframe, and it's a number between 0 and 1000, inclusive.

As to making the "screen bounce", you'd have to elaborate more on that!

I'd personally try to CFrame the camera by an offset determined by

math.random()*Loudness*Multiplier 

-on both X and Y axis each RenderStep, preferably with a multiplier <1, but that's just me.

Try and experiment, that's all I can tell you without further info on what you're trying.

Ad
Log in to vote
0
Answered by 4 years ago
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

This is the script I have.

Answer this question