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

How do I make another camera that rotates the same as the CurrentCamera?

Asked by 4 years ago
Edited 4 years ago

I created a camera for a ViewportFrame and I was hoping that I could have my ViewportFrame camera's rotation sync with the Workspace's camera, but keep it's position the same. How could I do this? Here's the code:

local frame = script.Parent
local player = game.Players.LocalPlayer
local part = frame.Part
local questGoal = game.Workspace.QuestGoal
local workspaceCamera = game.Workspace.Camera
local camera = Instance.new("Camera")
-- Below is the Camera properties being set
camera.CFrame = CFrame.new(Vector3.new(-2, 0, -2), part.Position)
camera.CameraSubject = part
camera.Parent = frame
frame.CurrentCamera = camera

while true do
    part.CFrame = CFrame.new(Vector3.new(0, 0, 0), questGoal.Position)
    wait()
end

Answer this question