Help with tweening script for piggy game

You never declared what the camera was in the tweenInfo. This is the new version.

local mainMenuMap = workspace:WaitForChild("MainMenuMap")
local tweenService = game:GetService("TweenService")
local btn = script.Parent

local currentCamera = game.Workspace.CurrentCamera
currentCamera.CameraType = Enum.CameraType.Scriptable

local function tweenCamera(pos,tweenTime)
     tweenService:Create(currentCamera,TweenInfo.new(tweenTime,Enum.EasingStyle.Linear),{CFrame = pos.CFrame}):Play()
end

btn.MouseButton1Click:Connect(function()
    btn.Visible = false
    btn.Parent.TextLabel.Visible = false

    tweenCamera(mainMenuMap.CameraPart2,1)
    wait(1)
    print("Reached Destination")
end)
1 Like

That does it! Thank you for taking like 30 messages to fix this haha!