Hello all, so today I am trying to match up the ViewportFrame camera with the main camera by setting it's CFrame. I have code attached. The script is the child of the ViewportFrame.
wait(3)
while 2+2==4 do
local viewportFrame = script.Parent
local viewportCamera = Instance.new("Camera")
viewportFrame.CurrentCamera = viewportCamera
viewportCamera.Parent = viewportFrame
local camera = workspace.CurrentCamera
local cameraCFrame = camera.CFrame
local viewCFrame = viewportCamera:GetRenderCFrame()
viewportCamera.CFrame = CFrame.new(Vector3.new(cameraCFrame))
print(viewCFrame)
wait(0.1)
end
Thank you! Any help is appreciated.

1 comment
Sorry if my code is messy. I am new to Lua!