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

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

Asked by 6 years ago
Edited 6 years ago
  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.

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) ThatPreston 354 — 6y
0
Im pretty sure its possible but I havent messed with cameras and CFrame too much DaWarTekWizard 169 — 6y

1 answer

Log in to vote
1
Answered by
Rare_tendo 3000 Moderation Voter Community Moderator
6 years ago
Edited 6 years ago

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

0
Yup! it works! tysm for helping me with :D cruizer_snowman 117 — 6y
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 chacha489 16 — 5y
Ad

Answer this question