How to Tween A Camera

im trying to tween a camera so that it matches the position and the orientation of a part

local area = 1
local Gui = game.Players.LocalPlayer.PlayerGui:WaitForChild("ScreenGui")
local camera = game.Workspace.Camera
camera.CameraType = Enum.CameraType.Scriptable

Gui.Left.MouseButton1Click:Connect(function()
	local returnedvalue = game.ReplicatedStorage.RemoteFunction:InvokeServer(area)
	local tweenservice1 = game:GetService("TweenService")
	local tweeninfo1 = TweenInfo.new(1, Enum.EasingStyle.Sine, Enum.EasingDirection.Out, 0, false, 0)
	local partproperty1 = {CFrame = CFrame.new(returnedvalue)} -- it doesnt work
	local tween1 = tweenservice1:Create(camera, tweeninfo1, partproperty1)
	tween1:Play()
end)
local cameras = game.Workspace.Cameras:GetChildren()

game.ReplicatedStorage.RemoteFunction.OnServerInvoke = function (player, area)
	if area < #cameras then
		return cameras[area+1].CFrame
	end
end

i have the CFrame of the object which is ‘returnedvalue’ but how do i use this in the tween properties

1 Like

So the second script returns a CFrame, why would you put that into CFrame.new()?

Cframe.new(Cframe) doesnt make sense

try using partproperty1 = {CFrame = returnedvalue}

1 Like

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