Tween does not go to each brick, but tweens strait to the end

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!

I am trying to Tween the camera to each block in the folder here:

image

My problem is that the script does this:

But I am looking for it to do this:


(Obviously in a smoother style)

Here’s my script:

local TweenService = game:GetService("TweenService")
local cfStart = nil
local duration = 1
local GIF = game.Workspace.GameIntroCutscenefolder
local cameratable = {GIF.A,GIF.B, GIF.C, GIF.D, GIF.E }


local function tweencamerastartmenu()
	print("initilizing")
	local music =  game.Workspace:FindFirstChild("JoinMusic")
	if music then
		music:Play()
	else
		print("Music not found")
	end
	
		---------------- Camera tweening -------------------
	game.Workspace.CurrentCamera.CFrame = GIF.A.CFrame
	for i, child in ipairs(cameratable) do
		print(i, child)
		
		local cfGoal = child.CFrame

		--i = math.min(i + duration, 1)
		--local a = TweenService:GetValue(i, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
		--local cfTween = cfStart:Lerp(cfGoal, a)

		local TS = game:GetService("TweenService")
		local Ti = TweenInfo.new(5)

		TweenService:Create(game.Workspace.CurrentCamera, Ti, {CFrame = cfGoal}):Play()
		print("Ran")
	end

	
	
	
end

wait(2)

tweencamerastartmenu()

I’m looking for a smooth tween between each brick in order. It’s supposed to be like a cutscene

make it wait until the tween is completed

local Tween = TweenService:Create(game.Workspace.CurrentCamera, Ti, {CFrame = cfGoal})
Tween:Play()
Tween.Completed:Wait()
print("Ran")
4 Likes

I can’t see the script from here, but from the video, you need to make the tween a function that returns true. Then call it like this

local success = tweenfunction(pointa, pointb)

This will force the script to wait.

1 Like