:GetChildren() Printing nil

  1. What do you want to achieve? I want to make the borders in my game have CanCollide on after an event.

  2. What is the issue?
    I am trying to get borders for my four corners game with GetChildren() but it prints nil

  1. What solutions have you tried so far? I tried to use :FindFirstChild(), it works, but it only selects one of them. I looked on the dev forum but I couldn’t find the issue.

Can we see the code and the explorer to help us determine the problem?

It is basically a mini game system I am trying to make, here is the code

Screen Shot 2022-09-25 at 1.45.15 PM

GetChildren returns a table, not all instances as a single object, so you must use for do to see each object

for _, Object in pairs(borders) do
	print(Object.Name)
	-- Code
end

And next time, paste the code into a code block instead of using an image.
For the code block, it must be between 3 grave accents (```).

-- Example
2 Likes

Which line did you try to print, which gave you nil?

Thanks so much! I forgot about those.

1 Like

I am still confused as your method should have worked, but glad it is solved.

1 Like