Problem: When the player touches a part, I play a simple Tween but, as soon as the player clicks or Clicks a Key, the tween stops working.
local TweenSevice = game:GetService(“TweenService”)
local cuttime = 2
local Tweenpart1 = game.Workspace.LobbyItems.MenuCams:WaitForChild(“Cam1”)
local Tweenpart2 = game.Workspace.LobbyItems.MenuCams:WaitForChild(“Cam2”)
local Tweeninfo = TweenInfo.new(
cuttime,
Enum.EasingStyle.Linear,
Enum.EasingDirection.In,
0,
false,
0
)
part.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
Cam.CameraType = Enum.CameraType.Scriptable
Cam.CFrame = Tweenpart1.CFrame
local tween = TweenSevice:Create(Cam,Tweeninfo,{CFrame = Tweenpart2.CFrame}) --- getting tween info
tween:Play()--Playig it
wait(cuttime)
Cam.CFrame = Tweenpart2.CFrame
end
end)