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

How would you change a players FOV (field of view) based on the music playing?

  1. so i was wondering how you would change a players FOV based on the music playing, so basically imagine that your in a game and music is playing, based on the beat / base of that music, the players FOV would increase or decrease. when the song would stop, it would return to normal. If you could answer this with a script or a link to somewhere explaining how to do this, it would be really helpful, Thanks!

EDIT: I'm wondering this because i know a game that does what i just described, it changes the FOV based on the music.

2 comments

0

This isn't possible. As far as I know, scripting can't detect the beat of music. To roblox, the music in games is literally just a sound. Nothing is listening to and interpreting it. (Unless you have some kind of custom beat system)

0

Im pretty sure its possible but I havent messed with cameras and CFrame too much

1 answer

This is possible, as the developers of Jailbreak have already done so. PlaybackLoudness returns a value between 0 and 1000, showing how loud the sound is.

Try this:

local cam = workspace.CurrentCamera
local RS = game:GetService('RunService')
local sound = workspace.Sound -- Let's say there's a sound in workspace that's playing

RS.RenderStepped:Connect(function()
        if sound.IsPlaying the --check to see if the sound is playing.
               cam.FieldOfView = 70+((sound.PlaybackLoudness/1000)*5)
        end
end)

Not has been tested, but it should work

2 comments

0

Yup! it works! tysm for helping me with :D

0

Ayo man thx so much but just had to tell u I had hard time cuz u wrote the and not then in the 6th line

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