You can write your topic however you want, but you need to answer these questions:
Hello, Developers
I having Trouble Displaying the Pet Model on a ViewportFrame. The ViewpoerFrame displays Grey Box or Color on it. Could Anybody Help Me Out
-
What do you want to achieve? Keep it simple and clear!
I’m trying to make The Pet Model to show on the ViewportFrame On the Pet Ui.
-
What is the issue? Include screenshots / videos if possible!
The ViewportFrame Appears Gray
If anybody Recommend How to do it or have a solution. I Would Really Appreciate it.
—Table—
---Table---
local PetList = {
Pets = {
["Aqua Dragon"] = {
Chance = 10,
Rarity = "Ultra Rare",
Name = "Aqua Dragon",
Model1 = game.Workspace:WaitForChild("Pets"):WaitForChild("Aqua Dragon").MeshPart
},
["Dog"] = {
Chance = 15,
Rarity = "Rare",
Name = "Dog",
Model1 = game.Workspace:WaitForChild("Pets"):WaitForChild("Dog").MeshPart
},
["Cat"] = {
Chance = 15,
Rarity = "Rare",
Name = "Cat",
Model1 = game.Workspace:WaitForChild("Pets"):WaitForChild("Cat").MeshPart
},
["Bear"] = {
Chance = 25,
Rarity = "Uncommon",
Name = "Bear",
Model1 = game.Workspace:WaitForChild("Pets"):WaitForChild("Bear").MeshPart
},
["Ice Golem"] = {
Chance = 35,
Rarity = "Common",
Name = "Ice Golem",
Model1 = game.Workspace:WaitForChild("Pets"):WaitForChild("Ice golem")["Meshes/sil (38)"]
}
}
}
—Function&Tween—
---function---
local size = UDim2.new(0, 100, 0, 100)
local TS = game:GetService("TweenService")
function PetList.Sort(Player : Player)
wait(5)
local PetFrame = Player.PlayerGui.ScreenGui.HatchFrame.PetList.PetInfo
for i,v in pairs(PetList.Pets) do
local PortNew = Instance.new("ViewportFrame")
local New = PetFrame:Clone()
PortNew.Parent = New
PortNew.Position = UDim2.new(0.5,0,0.5,0)
PortNew.Size = size
PortNew.AnchorPoint = Vector2.new(0.5, 0.5)
New.AnchorPoint = Vector2.new(0.5,0.5)
New.Parent = Player.PlayerGui.ScreenGui.HatchFrame.PetList
New.Name = v.Name
warn(tostring(v.Chance).." , "..v.Name.." , "..v.Rarity)
New.Chance.Text = tostring(v.Chance)
New.Rarity.Text = v.Rarity
New.PetName.Text = v.Name
local Cam = Instance.new("Camera")
PortNew.CurrentCamera = Cam
Cam.Parent = PortNew
print(Cam.Parent)
Cam.CFrame = CFrame.new( v.Model1.Position , v.Model1.Position)
print("done!")
local cameraGoal = {
CFrame = CFrame.new(Vector3.new(0, 6, 4), game.Workspace.PlayerBan.Position),
}
local tweenInfo = TweenInfo.new(2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
local tween = TS:Create(Cam, tweenInfo, cameraGoal)
tween:Play()
end
end
return PetList
- If Anybody could Help I would really appreciate