A friend and I are trying to make a UI that shows images of objects via ViewportFrame. For some reason it won’t work without using the PivotTo function, and also doesn’t go directly in front of the object that we’re trying to project. Any help/code would be appreciated. Thanks!
tradeScrollingFrame.ChildAdded:Connect(function(child)
local viewportcamera = Instance.new("Camera",script)
viewportcamera.CameraType = Enum.CameraType.Scriptable
local item = workspace:FindFirstChild(child.Name):Clone()
local viewportpoint = Vector3.new(1, 18, 16)
child.BackgroundTransparency = 1
child.CurrentCamera = viewportcamera
item:PivotTo(CFrame.new(viewportpoint))
item.Parent = child
end)