FOV Tween won't play?

I’m trying to make it so when a player touches a part their FOV tweens into a lower amount; after some time it changes back to normal.

My script is not working despite multiple sources on the forum saying this was the correct way; I’ve tried multiple other methods and I really do not want to use a loop for the script.

LocalScript

local plr = game:GetService("Players").LocalPlayer
local camera = workspace.CurrentCamera
camera.CameraType = Enum.CameraType.Scriptable

local gas = script.Parent

local ts = game:GetService("TweenService")
local tweenInfo = TweenInfo.new(
	1,
	Enum.EasingStyle.Back,
	Enum.EasingDirection.InOut
)

local touched = ts:Create(camera, tweenInfo, {FieldOfView = 25})
local turned = ts:Create(camera, tweenInfo, {FieldOfView = 100})

gas.Touched:Connect(function(hit)
	touched:Play()
	wait(4)
	turned:Play()
end)

Does the gas.Touched event fire?

Also, the script would run if anything (other players, other parts etc) touches it, so do a check like this:

if game.Players:FindFirstChild(hit.Parent.Name) == plr then
    touched:Play()
    wait(4)
    turned:Play()
end

it does fire and thank you for the tip

local scripts dont work on workspace !!!1

same issue here

1 Like

i thought they did LOL
sorry im stupid

They technically can now (via a beta feature).