Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to switch Camera View from my camera part to my current camera?

I am trying to switch my players camera view from my camera part to my current camera and back. Can anyone help? My progess: local plr = game.Players.LocalPlayer local camera = workspace.CurrentCamera local mainMenuMap = workspace:WaitForChild("MainMenuMap") local tweenService = game:GetService("TweenService") local btn = script.Parent

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

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

end)

1 comment

0

Put the code in lua format so it is easier for me to answer

1 answer

local plr = game.Players.LocalPlayer local camera = workspace.CurrentCamera local mainMenuMap = workspace:WaitForChild("MainMenuMap") local tweenService = game:GetService("TweenService") local btn = script.Parent

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

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

repeat wait() camera.CameraType = Enum.CameraType.Custom until camera.CameraType == Enum.CameraType.Custom camera.CFrame = workspace.Camera.CFrame

end)

This discussion is preserved as it was. New answers, comments, and votes are closed.