Current Camera is not a valid member of Frame

Hello, so I am trying to make a frame that acts as a character display gui but I am getting this error can someone help me fix it? This is my script:

local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()

local VPFcam = Instance.new(“Camera”); VPFcam.Parent = script.Parent.ViewportFrame
VPFcam.CFrame = CFrame.new(0,0,0)
script.Parent.ViewportFrame.CurrentCamera = VPFcam

repeat wait(.1) until game:IsLoaded()

character.Archivable = true

local ClonedChar = character:Clone()

ClonedChar.Parent = script.Parent.ViewportFrame.WorldModel
ClonedChar.Humanoid.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None
ClonedChar:SetPrimaryPartCFrame(CFrame.new(Vector3.new(0,0,-9.5), Vector3.new(0,0,0)))

It is in a localscript if you couldn’t tell.

1 Like

Can you copy and paste the entire error? From the title, it obviously means your ViewportFrame is not actually a ViewportFrame, but a Frame.

Ohhhh yeah, I think I did it as a frame- :sweat_smile:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.