Camera react slightly to sounds

Hello! So I was wondering this question:

Is it possible to make the player’s camera FOV react with the playbackLoudness of ALL audios?

For instance, if I were to shoot a gun, could the camera react to the sound? I would also like this for other shots from other players.

let me know if you got something for me :slight_smile:

1 Like

One thing I can think of off the top of my head is to get the descendants of the game for sounds when the game starts, hook those up to RenderStepped, and do it that way. However I’m not sure if that would cause your game to be slower. An alternative way that I can think of is to tag all the sounds with CollectionService and then every frame you could get the objects tagged as a sound, and add the sum of all of the PlaybackLoudness properties. You would probably want to cap this off with something like this:

if loudnessSum > 1000 then
    loudnessSum = 1000
end

But just experiment with it and see what works. Hope this helps!

3 Likes

math.clamp() can be used too :star_struck: