TweenService Help

I recently started to use TweenService more I am having a problem in changing a players CameraMaxZoomDistance I am not sure why this script is not working

local cd = script.Parent.ClickDetector
local ts = game:GetService(“TweenService”)
cd.MouseClick:Connect(function(plr)
ts:Create(plr,TweenInfo.new(5),{CameraMaxZoomDistance = 0.5})
end)

I have also tried with a local script(Parented in StarterGui)

local ts =game:GetService(“TweenService”)
local cd = game.Workspace.GreenClient.ClickDetector
cd.MouseClick:Connect(function(plr)
ts:Create(plr,TweenInfo.new(4),{CameraMaxZoomDistance = 0.5})
print(plr)
end)

I made something like this dont know it work or not test this

local TS = game:GetService(“TweenService”)

local info = TweenInfo.new(5,Enum.EasingStyle.Linear,Enum.EasingDirection.Out)

local goal = {

CameraMaxZoomDistance = 0.5

}

local players = game:GetService(“Players”)

local player = players.LocalPlayer

local Tween = TS:Create(player,info,goal)

local cd = game.Workspace.GreenClient.ClickDetector

cd.MouseClick:Connect(function(plr)

Tween:Play()

end)

1 Like

I think I just figure out the solution to my problem while reading this
I completely forgot to do Play()
how dumb of me but thank you for helping

1 Like