GetChildren from folder

Hi,

I am trying to get all parts from a folder and save their positions into a table/array.

Below is what I thought would work but it will not allow me to save the location of the part.

what am I doing wrong?

local tilePositions = {}

for i, child in ipairs(game.Workspace.ChessSet.Tiles:GetChildren()) do
	tilePositions[i] = Vector3.new(child.X, child.Y, child.Z)
end

You would have to do Vector3.new(child.Position.X, child.Position.Y, child.Position.Z). Or just do tilePositions[i] = child.Position.

1 Like