Setting FieldOfView to 120 causes console to spam "Out of range" error

Hello, everyone!

Fairly recently, setting the FieldOfView to 120 causes the developer console to spam this error message every second:

I don’t have a loop that repeatedly sets the FieldOfView every second.

However, this error still comes up repeatedly.

How I set the FieldOfView:


workspace.CurrentCamera.FieldOfView = game.Players.LocalPlayer.Settings.FOV.Value

The FOV value is clamped to 120, though I’m considering clamping to 119 since 120 seems to be out of range.

There’s also really no reason to spam the console like this - all it does is slow the framerate and gets in the way of actual meaningful errors and warnings.

1 Like

I’m willing to bet that this is caused by floating point issues. It looks like you’re storing the value in a NumberValue. Odds are the value is actually something like 120.00000000000000001, which causes this problem. You also likely have a loop you’re not aware of, because this only sends the message once and I cannot reproduce it spamming the console.

5 Likes