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)