Problems with tweening FOV

Basically I am making a game where if you sprint your FOV raises a little and vice versa. Because I want the FOV raise to be smooth I thought using tweenService to tween the FOV value. The issue is that when I play the tween I get this error in output:


I have tried searching for that issue but nothing helpfull came out.

my tweening script:

local TweenService = game:GetService("TweenService")
local tweenInfo = TweenInfo.new(0.25,Enum.EasingStyle.Quad)
local camera = game:GetService("Workspace"):WaitForChild("Camera")

local camTween = TweenService:Create(camera.FieldOfView.Value, tweenInfo, {Value = 90})
camTween:Play()

Try this.

local camTween = TweenService:Create(camera, tweenInfo, {FieldOfView = 90})

What you did wrong is that you tried to tween the property FieldOfView’s value (which is already a number by itself)

1 Like

This cannot be what you want, you need to put the property in this case

{FieldOfView = 90}

1 Like