My Anti-Z fighting script wont work

I just goes halfway and stops changing the positions.

Code:

local Group = script.Parent
local things = {}

for i,v in Group:GetChildren() do
	if v:IsA("Part") then
		table.insert(things, v)
	end
end


for i = 1, #things, 2 do
	local val = things[i]
	val.Position += Vector3.new(0, 0.01, 0.01)
end



1 Like

Is there a reason you’re incrementing by 2 in your loop?

Can you show the contents of Group?

I want to get every second part, so that second part, I lower the size a little bit.

I don’t think they parts are being returned to you in any particular order, which might make it look as though it stopping, but really its just not giving you the visual results you need.

Try changing the color of each part it shifts size, and see if half of your parts are being colored or not.
Such as a bright green.

or print out the total number of parts, and then have a counter count each part touched, and see if you get 1/2 the total amount on the counter