Model's PrimaryPart will occasionally never load

for i = 1 , 5 do
	for i , tile in pairs(tiles.ChunkRows[1][i]) do
		local new = tile:Clone()
		local Time = 0
		new.Parent = workspace.Top
		wait()

		new:PivotTo(new:GetPrimaryPartCFrame() + Vector3.new(0,0,tiles.Size))
	end
end

This script clones an array of tiles then moves them by tiles.Size in a given axis, the problem is that when doing this, the game may throw an error that indicates that the model has no PrimaryPart, every element in the arrray is the exact same model, and this doesn’t always happen, trying a :WaitForChild() just yields infinitely for seemingly no reason.

Would Instance:GetPropertyChangedSignal("PrimaryPart"):Wait() suffice? You may have already had this idea.

To avoid potential indefinite yielding.

if not Model.PrimaryPart then
	Model:GetPropertyChangedSignal("PrimaryPart"):Wait()
end

It seems to yield forever in those cases

In that case consider replacing new:GetPrimaryPartCFrame() with new:GetPivot() instead.

Haven’t seen that, I will try it.

Yeah that seemed to work, I was starting to wonder what these new pivot functions did, i guess there´s my answer lol.