Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 4 years ago
Edited 4 years ago

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)

0
Put the code in lua format so it is easier for me to answer ConorG234 39 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

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)

Ad

Answer this question