#inventory viewport frame help

1 messages · Page 1 of 1 (latest)

versed bear
#

so i want to make some code which will have a image of the part/model that i want to show. Now i want it to be centered e.g and im wondering how

#

so i did try something simple like this but i got no error and no camara or egg inside the viewportframe upon testing

local eggViewPortFrame = script.Parent.ViewportFrame
local Egg = game:GetService("ReplicatedStorage"):WaitForChild("Eggs").BasicEgg

eggViewPortFrame:ClearAllChildren()
eggViewPortFrame.Position = UDim2.fromScale(0.5, -0.5)
eggViewPortFrame.Size = UDim2.fromScale(0, 0)

local eggMesh = Egg:Clone()
eggMesh.Parent = eggViewPortFrame
eggMesh.CFrame = CFrame.new(0, 0, 0)

local camara = Instance.new("Camera")
camara.Parent = eggViewPortFrame
camara.CFrame = CFrame.new(0, 0, 5)
eggViewPortFrame.CurrentCamera = camara```