Camera tween messing up


First I copied the CFrame of the camera.
Placed values correctly, and hit play.

local function TweenCameraFromMatrix(Region)
	local CameraType = workspace.CurrentCamera.CameraType
	workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
	for i , v in pairs(Region:GetChildren()) do
		if v:IsA("Folder") then
			v = Region:FindFirstChild("MatrixVectors" .. i)
			local Properties = {
				CFrame = CFrame.fromMatrix(
					v.Position.Value,
					v.UpVector.Value,
					v.RightVector.Value
				)}	
			local tween = game.TweenService:Create(workspace.CurrentCamera , TweenInfo.new(((workspace.CurrentCamera.CFrame.Position - v.Position.Value).Magnitude / 7) , Enum.EasingStyle.Linear) , Properties )
			tween:Play()
			tween.Completed:Wait()
			wait(2.5)
		end
	end
end

The result Points at a different direction.

Also just to be sure, the order in which camera.CFrame is printed out is Position , UpVector, RightVector and then LookVector

I have no clue as to why this is happening but I am going to offer a solution.

When printing your goal CFrame, print the entirety of it, not just the vectors. Then when constructing your CFrame, use CFrame.new and pass all 12 components in the same order.

Hey that makes sense, gonna try that be right back.

1 Like