Camera not tweening smoothly between parts and just snapping

Hi, I’m having a problem with tweenservice not tweening smoothly between parts, it just snaps to the next part when the time i set is over. I do not want this.

I’ve tried changing the easingstyle to see if that was the problem but it wasnt, but im not sure why else this coul dbe happening.

here is the script im using (in startergui), i followed AlvinBlox’s tutorial.

local tweenService = game:GetService("TweenService")

local camera = game.Workspace.CurrentCamera




function tween(part1, part2, cutsceneTime)
	
	local tweenInfo = TweenInfo.new(
		cutsceneTime, 
		Enum.EasingStyle.Linear,
		Enum.EasingDirection.Out,
		0, 
		false,
		0
	)
	
	
	camera.CameraType = Enum.CameraType.Scriptable
	camera.CFrame = part1.CFrame
	
	local tween = tweenService:Create(camera, tweenInfo, {CFrame = part2.CFrame})
	
	wait(cutsceneTime)
	
	camera.CameraType = Enum.CameraType.Custom
end

game.ReplicatedStorage.Cutscenes.CarnivalCutscene.OnClientEvent:Connect(function()
	tween(game.Workspace.Cutscenes.CarnivalCutscene.Part1, game.Workspace.Cutscenes.CarnivalCutscene.Part2, 3)
	tween(game.Workspace.Cutscenes.CarnivalCutscene.Part2, game.Workspace.Cutscenes.CarnivalCutscene.Part3, 0)
	tween(game.Workspace.Cutscenes.CarnivalCutscene.Part3, game.Workspace.Cutscenes.CarnivalCutscene.Part4, 2.5)
	tween(game.Workspace.Cutscenes.CarnivalCutscene.Part4, game.Workspace.Cutscenes.CarnivalCutscene.Part5, 0)
	tween(game.Workspace.Cutscenes.CarnivalCutscene.Part5, game.Workspace.Cutscenes.CarnivalCutscene.Part6, 3)
end)
1 Like

you forget to play tween?
also I changed easingstyle for the smooth animation

local tweenService = game:GetService("TweenService")

local camera = game.Workspace.CurrentCamera




function tween(part1, part2, cutsceneTime)
	
	local tweenInfo = TweenInfo.new(
		cutsceneTime, 
		Enum.EasingStyle.Sine,
		Enum.EasingDirection.InOut,
		0, 
		false,
		0
	)
	
	
	camera.CameraType = Enum.CameraType.Scriptable
	camera.CFrame = part1.CFrame
	
	tweenService:Create(camera, tweenInfo, {CFrame = part2.CFrame}):Play()
	
	wait(cutsceneTime)
	
	camera.CameraType = Enum.CameraType.Custom
end

game.ReplicatedStorage.Cutscenes.CarnivalCutscene.OnClientEvent:Connect(function()
	tween(game.Workspace.Cutscenes.CarnivalCutscene.Part1, game.Workspace.Cutscenes.CarnivalCutscene.Part2, 3)
	tween(game.Workspace.Cutscenes.CarnivalCutscene.Part2, game.Workspace.Cutscenes.CarnivalCutscene.Part3, 0)
	tween(game.Workspace.Cutscenes.CarnivalCutscene.Part3, game.Workspace.Cutscenes.CarnivalCutscene.Part4, 2.5)
	tween(game.Workspace.Cutscenes.CarnivalCutscene.Part4, game.Workspace.Cutscenes.CarnivalCutscene.Part5, 0)
	tween(game.Workspace.Cutscenes.CarnivalCutscene.Part5, game.Workspace.Cutscenes.CarnivalCutscene.Part6, 3)
end)

this is very embarrassing for me let me try it

1 Like

thats alright, we all have that moments.

2 Likes

thank you it worked
i cant believe i forgot to add :play(

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.