Studio is not detecting the child of a frame?

I’m trying to create a Julius set generator. The problem right now is that my script isn’t detecting that a text label with the frame exists. Here is the area that is erroring.

local gui = script.Parent
local buttons = gui:FindFirstChild("Buttons")
local mainSettings = gui:FindFirstChild("JuliusSettings")
local coordButton = mainSettings:FindFirstChild("CoordButton")
local generButton = mainSettings:FindFirstChild("GenerateButton")
local iterBox = mainSettings:FindFirstChild("Iterations"):FindFirstChild("TextBox") --this is the line that's erroring

image

image

I have tried using WaitForChild(), but it just yielded forever. I also tried checking for typos, and the same error came up. I also tried renaming and making a different textlabel instead, but it still doesn’t work.

(Edit: I have just realized I’ve been spelling Julia wrong. I don’t know why I’m putting this here but there you go)

1 Like

change FindFirstChildWaitForChild and try again.

1 Like
local iterBox = mainSettings:WaitForChild("Iterations"):FindFirstChild("TextBox")
local iterBox = mainSettings:FindFirstChild("Iterations"):FindFirstChild("TextBox") --this is the line that's erroring

I advice you to seperate this into two different variables while accounting for if the object exists or not whenever calling the FindFirstChild method… Usually you would use that method if your unsure if the object exists or not also take note that FindFirstChild does not yield for an object to load in… Try doing something like this

local gui = script.Parent
local buttons = gui:WaitForChild("Buttons")
local mainSettings = gui:WaitForChild("JuliusSettings")
local coordButton = mainSettings:WaitForChild("CoordButton")
local generButton = mainSettings:WaitForChild("GenerateButton")
local Iterations = mainSettings:WaitForChild("Iterations")

local iterBox = Iterations:WaitForChild("TextBox") -- we replace the `FindFirstChild` method with `WaitForChild` that yields the script until the child has loaded in
1 Like

Its because there are two objects with the same name, ‘JuliusSettings’ one is a script, one is a frame.

image

1 Like

Thank you so much! I feel like an idiot now lol.

I will also take your advice on that. Thank you!