Hello. I am making a simulator an my viewport frames inside of my inventory is not working. This is the code that creates it:
function view:InventoryViewPoint(params)
local petModel = game.ReplicatedStorage.__Inventory.Pets:FindFirstChild(params.Name);
local clone = petModel:Clone();
local viewPort1 = script.petTemplate:Clone()
viewPort1.Name = params.Name;
local viewPort = Instance.new("ViewportFrame", viewPort1.Main.Top)
viewPort1.Parent = params.Parent;
viewPort.Size = UDim2.new(1,0,1,0)
viewPort.Position = UDim2.new(0,0,0,0)
viewPort.BackgroundTransparency = 1
local camera = Instance.new("Camera")
viewPort.Name = params.Name;
camera.Parent = viewPort;
viewPort.ClipsDescendants = true
viewPort.CurrentCamera = camera;
return params.Parent;
end
This code uses it:
local temp = require(script.Viewport):InventoryViewPoint({
Name = value.Name;
Parent = f;
})
However, the image on the viewport isn’t displaying.
First time using viewports by the way.