Struggling with gui function

How do i make a single gui frame from an ancestry like the image be shown , frames are the actual containers , buttons are what is inside and no 2 frames should be visible at a time and i have an array with all the frame instances i just didnt know how to use it , and frame containers can be children of other frame containers

this is what i tried so far

main folder is the folder that has the buttons that show the main frames then theres buttons in those frames to show the child frames

The gui needs to be generated from file so it can be changed easily

ViewportAssets has the values that determine how the ancestry is generated

function ShowFrame(frame)
	print(frame)
	if frame.Parent == furnFolder then
		ChangeMenu(true)
		for i, v in pairs(furnFolder:GetChildren()) do
			v.Visible = false
		end
	else
		
		for i, v in pairs(furnFolder:GetChildren()) do
			local Ancestor = frame:FindFirstAncestor(v.Name)
			if Ancestor then
				print(Ancestor.Name)
			end
		end
		--for i, v in pairs(frame:GetChildren()) do
		--	v.Visible = true
		--end
		frame.Visible = true
	end
end

function ChangeMenu(bool)
	mainFolder.Visible = not mainFolder.Visible
	if bool and bool == true then
		mainFolder.Visible = true
	else
		mainFolder.Visible = false
	end
end




1 Like

Hello, I’m slightly confused on what you need.

My best guess is you need help making the frames invisible while only keeping one visible, if that’s the case then just do a for loop with an exception to the Frame.

Though you seem to already have this which is why I am confused.

Also what exactly is this for? Is this a way to interact with objects? Because there are better methods on doing that then making a ton of Frames (No offense!).