I was making an inventory GUI with viewport frames, and I can’t figure out what I’m doing wrong. I have spend much time trying to figure out, thank you.
function create(name)
-- template is the viewport
local modelclone = sticklibrary[name].Model:Clone()
local grr = Instance.new("Model")
local cam = Instance.new("Camera")
local template = script.Template:Clone()
template.Name = sticklibrary[name].Name
local f = modelclone:GetChildren()
for d = 1, #f do
f[d].Parent = grr
end
modelclone:Destroy()
cam.CFrame = CFrame.new(Vector3.new(0, 2, 12), Vector3.new(grr:GetPivot().X,grr:GetPivot().Y,grr:GetPivot().Z))
cam.Parent = template
grr.Parent = template
template.CurrentCamera = cam
template.Parent = script.Parent.Background.InventoryContents
end
FYI, the reason I destroyed “modelclone” is because it was a part acting like a model, so I switched it to make it an actual model.
