Camera Tween doesnt work

basically, i have a script where once you start a proximity prompt, a camera tween should start playing. however, the tween never plays, no errors

CODE:

local Prox = script.Parent
local Player = game:GetService("Players")

local Camera = workspace.CurrentCamera
local TweenService = game:GetService("TweenService")
local Char
local CameraFixing = TweenInfo.new(.4, -- Time
	Enum.EasingStyle.Quad, -- EasingStyle
	Enum.EasingDirection.InOut, -- EasingDirection
	-1, -- RepeatCount (when less than zero the tween will loop indefinitely)
	false, -- Reverses (tween will reverse once reaching it's goal)
	0 -- DelayTime) -- Let's use all defaults here
)

local CameraFix1 = TweenService:Create(Camera, CameraFixing, {
	CFrame = Prox.Parent.Parent.ProxCam1.CFrame
})


local CameraFixing2 = TweenInfo.new(4, -- Time
	Enum.EasingStyle.Quad, -- EasingStyle
	Enum.EasingDirection.InOut, -- EasingDirection
	-1, -- RepeatCount (when less than zero the tween will loop indefinitely)
	true, -- Reverses (tween will reverse once reaching it's goal)
	0 -- DelayTime) -- Let's use all defaults here
)

local CameraFix2 = TweenService:Create(Camera, CameraFixing, {
	CFrame = Prox.Parent.Parent.ProxCam2.CFrame
})

Player.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		Char = char
		task.wait(1)
		local FixAnim = char.Humanoid.Animator:LoadAnimation(script:WaitForChild("Animation"))
	
		


Prox.PromptButtonHoldBegan:Connect(function()
	FixAnim:Play()
			CameraFix1:Play()
			--task.wait(.4)
			--CameraFix2:Play()
end)

Prox.PromptButtonHoldEnded:Connect(function()
			FixAnim:Stop()
			CameraFix1:Cancel()
			CameraFix2:Cancel()
end)

Prox.Triggered:Connect(function()
			print("Fuse Fixed")
			CameraFix1:Cancel()
			CameraFix2:Cancel()
			FixAnim:Stop()
end)
		
	end)
end)




Firstly, you made a typo at the TweenInfo when creating the CameraFix2 tween. It should be CameraFixing2.
Secondly, does the PlayerAdded event even fire?

1 Like

@Vaschex is right, but also make sure that the camera is scriptable.

1 Like