ViewportFrame Is Displaying more than one model - Help ViewportFrame

Hello Developers,

I’m having an issue with ViewportFrame Display more than one Model. I have tried Checking On the Devforum. I still couldn’t figure out the issue with

I would appreciate if somebody would help me

image

It appears you are using :Clone() on the viewport frame you already populated with a model. Instead I’d have a template and use :Clone() on that, which means you won’t have these problemss

I re-check my script i didnt see any ViewportFrame cloning twice.

function Open.Sort(Player : Player)



	print("Hello")
	local size = UDim2.new(1, 0, 0.8, 0)


	wait(10)
	local InfoTool = Player.PlayerGui.HatchDetector.MetalDetector1.ImageLabel.DetectorList.PetInfo

	for _, Info in pairs(Open.EggStand1) do
	
			warn("Wassup")
			-------Text, Raity, Chance----
			local New = InfoTool:Clone()

			New.Parent = InfoTool.Parent
			New.rarity.Text = Info.Rarity
			New.Chance.Text = tostring(Info.Chance).."%"
			New.Name = Info.Name
			------ViewportFrame-------------

			wait(2)
			local PortNew = Instance.new("ViewportFrame")
			PortNew.Parent = InfoTool
			PortNew.Name = Info.Tool.Name

			PortNew.Position = UDim2.new(0.5,0,0.5,0)
			PortNew.Size = size
			PortNew.AnchorPoint = Vector2.new(0.5, 0.5)
			PortNew.Transparency = 1

			local Cam = Instance.new("Camera")
			Cam.CameraType = Enum.CameraType.Scriptable
			PortNew.CurrentCamera = Cam
			Cam.Parent = PortNew
			warn("camera:", Cam)

			local clonedModel = Info.Tool:Clone()
			warn(tostring(clonedModel))
			clonedModel:SetPrimaryPartCFrame(CFrame.new(0, 0, 0))
			clonedModel.Parent = PortNew
			clonedModel.PrimaryPart.Anchored = true
				-----Make Anchor the clonedModel

			Cam.CFrame = clonedModel.PrimaryPart.CFrame * CFrame.new(0,0,5)
			Cam.CFrame = CFrame.new(Cam.CFrame.Position, clonedModel.PrimaryPart.Position)
			warn("camera done!")
			end


	

			wait(2)

	
		end


Here is my script if it helps

Hmm, no you are right, there was no cloning taking place. I don’t see anything immediately inside that script that would cause the issue.

I also tried to check if The is more than one ViewportFrame in a PetInfo Frame and returned a output


some of them have less than other.

Is it maybe that Open.EggStand1 has some issues? I don’t know why else there would be multiple ones getting created onto the same place

i think since it my looping through module more than once

let me try that

If i remove Open.Eggstand1 then i get this error

  18:14:49.748  ServerStorage.Tools.OpenCrate.ModuleScript:62: attempt to index function with 'Rarity'  -  Server - ModuleScript:62

I managed to fix the issue. I made a mistake in my code I set the viewportframe part to infotool instead of the New which is the cloned version

Thanks for the Help @ifkpop

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.