Code cant find the children of a ViewportFrame

local playerGui = game.Players.LocalPlayer:WaitForChild("PlayerGui")
	local domainGui = playerGui:WaitForChild("DomainUI")
	local frame = domainGui:WaitForChild("ViewportFrame")
	local image = frame:FindFirstChild("ShrineImage")
	if image then
		print("yes")
	else
		print("no")
	end
        frame.Visible = true

image

No matter what I change the names too it always shows the frame but prints “no”. I would like help as it detects the frame and its parents but it can’t find the decedents of the frame. (Its in a localscript in StarterPlayerScripts named “LocalScript”)

local frame = domainGui:WaitForChild("ViewportFrame")

The code I showed on top is most likely the problem as they can’t find a child with the name ViewportFrame, WaitForChild looks for the child’s name, you should try :WaitForChildOfClass.

Sorry, I need to edit the picture as I changed the name of it then took the picture, even with it being named “ViewportFrame”, it dosent detect it

I figured it out what the problem was. I figured it out.

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