What could be causing model flashing

I’m not sure why my model starts flashing when I move it around
robloxapp-20190915-1201571

Mouse.Move:Connect(function()
	if CurrentTopping then		
		for i, v in pairs(CurrentTopping:GetChildren()) do
			v.CanCollide = false
		end
			
		local UnitRay = workspace.CurrentCamera:ScreenPointToRay(Mouse.X, Mouse.Y, 1)
		local NewRay = Ray.new(UnitRay.Origin, UnitRay.Direction * 1000)
		local Hit, Pos = workspace:FindPartOnRayWithIgnoreList(NewRay, {CurrentTopping})
		
		local NewPos = Vector3.new(Pos.X, Pos.Y, Pos.Z)
		
		CurrentTopping:SetPrimaryPartCFrame(CFrame.new(NewPos))
	end
end)

Have you made sure the model is anchored as? My guess is what is going on is the parts being made uncollidable is making them constantly go through the ground.
Example change:

for i, v in pairs(CurrentTopping:GetChildren()) do
	v.CanCollide = false
	v.Anchored = true
end

If that isn’t the problem, then it could be something else outside of the code, because it works fine for me with a basic model of a few parts.

2 Likes