Changing FOV is not working?

I’ve got this script, everything works, but the FOV wont change for the player?

local UIS = game:GetService("UserInputService")
local TweenService = game:GetService("TweenService")

local Player = game.Players.LocalPlayer
local Character = script.Parent.Parent
local Humanoid = Character:WaitForChild("Humanoid")
local Animator = Humanoid:WaitForChild("Animator")
local HumRootPart = Character:WaitForChild("HumanoidRootPart")

local camera = game.Workspace.CurrentCamera

local DownTween = TweenService:Create(Humanoid, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {
	CameraOffset = Vector3.new(0,-1.77,-0.8)
	
})
local DownFOVTween = TweenService:Create(game.Workspace.CurrentCamera, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {
	FieldOfView = 100

})
local UpFOVTween = TweenService:Create(game.Workspace.CurrentCamera, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {
	FieldOfView = 85

})
local UpTween = TweenService:Create(Humanoid, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {
	CameraOffset = Vector3.new(0,0,-0.8)

})

--99893655201485

local SlideStartTrack = Animator:LoadAnimation(script.Slide1)
local SlideContinueTrack = Animator:LoadAnimation(script.Slide2)

UIS.InputBegan:Connect(function (input)
	if input.KeyCode == Enum.KeyCode.C or input.KeyCode == Enum.KeyCode.B then
		DownFOVTween:Play()
		DownTween:Play()
			SlideContinueTrack:Play()
		local LinearVelocity = Instance.new("LinearVelocity")
		LinearVelocity.Parent = HumRootPart
		LinearVelocity.Attachment0 = HumRootPart.RootAttachment
		LinearVelocity.MaxForce = 100000
		LinearVelocity.VectorVelocity = HumRootPart.CFrame.LookVector * 50
		LinearVelocity.Enabled = true
		wait(0.5)
		LinearVelocity:Destroy()
		
		print(HumRootPart.AssemblyLinearVelocity)
		repeat task.wait(0.1) until HumRootPart.AssemblyLinearVelocity.Magnitude <= 18
		SlideContinueTrack:Stop()
		UpTween:Play()
		UpFOVTween:Play()
	end
end)

Hi,

I tested it in roblox studio, and everything works…

1 Like

Hey, try debugging the FOV Tween

1 Like

there was another script interfering with it.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.