Viewport Frame won't display the camera view

So I am making a screen that has a surface GUI with a viewport frame inside. I also have a part setup as a camera.

What I want is that the viewport frame shows the view of the camera on the part.

The problem is that the viewport frame is blank. Is there any solutions to this or alternatives?

  • The surface GUI is inside StarterGUI and the adornee is setup for the screen part.
  • There is a local script inside of the surface GUI.

Local Script

local camera = Instance.new("Camera")
script.Parent.ViewportFrame.CurrentCamera = camera

camera.CFrame = CFrame.new(0, 0, game.Workspace.CamPart1.CFrame)

Note: I don’t have much experience in Viewport Frames

Why are you using a CFrame value to construct another CFrame value?

I made a simple demo just for you, you can open it up and see what you need:
viewportFrameExample.rbxl (36.9 KB)
To move the camera inside the viewport, you move your actual camera in the game itself

1 Like