Can I use Instance:FindFirstChild() and put a variable in the brackets?

The title says it all.

variable = "Part"
workspace:FindFirstChild(variable)

Yes, that will work, as long as it’s a string variable

local className = "Part"

local obj_one = workspace:FindFirstChildOfClass(className) -- finds a child in workspace with the className of "Part"
local obj_two = workspace:FindFirstChild(className) -- find a child with the name of "Part"
1 Like

Yes, that would work and there’s no issue with it, however a variable is not needed if you’re going to access it only once.

And, why can’t you just test it before posting it?