Identifying overlapping bricks

Hey, just a quick question.

Is there any plugin or method to finding accidental duplicates of parts? I find it tedious to try identify when I’ve duplicated a brick by accident and I was wondering how others handle that, if it’s even a problem for them.

2 Likes

Here’s a quick little function you can use in the command bar that iterates through the parts in workspace, and selects its touching parts that have the same Position, Orientation, and Size.

function selectDoubles()
	local checked = {}
	local doubles = {}
	
	for _, part in next, workspace:GetDescendants() do
		if part:IsA('BasePart') and part ~= workspace.Terrain then
			if checked[part] == nil then
				local transmitter = part.Touched:Connect(function() end)
				for _, touch in next, part:GetTouchingParts() do
					if touch.Position == part.Position and touch.Orientation == part.Orientation and touch.Size == part.Size then
						checked[touch] = not nil
						table.insert(doubles, touch)
					end
				end
				transmitter:Disconnect()
			end
		end
	end
	
	print('Selected', #doubles, ' duplicate parts')
	game.Selection:Set(doubles)
end
6 Likes

@XAXA I actually found the need for a position filter in your Part Picker.

As in, a filter for parts that have the exact same position?

EDIT: I think you should describe your usecase, too.

EDIT2: Oh. OP. Yeah, Adding a position filter would be useless here. I’ll whip up a script in a bit.

Honestly man I considered using his plugin to individually seek out parts, one by one… didn’t because of my sanity.

It’d be super cool as a feature, though!

Try this plugin. I just looked up “remove doubles plugin roblox” in google.

@MrMoonjelly That script wouldn’t work for non-CanCollide parts since GetTouchingParts will return nothing. You’ll need to employ this trick: Simple trick to make GetTouchingParts work with non-CanCollide parts

7 Likes

Thanks, had no idea I could do it through the command bar but it works!

Wish I had seen this six months ago. Brick Battle games go crazy if there are overlapping parts. So much work to make sure there are no duplicates or overlapps.

I came up for a very basic solution that works if you haven’t used any transparent parts in your project yet.

Just select the whole thing and set transparency to 0.5. That’ll allow you to see all the overlapping and if anything isn’t transparent, then there’s duplicate parts.

2 Likes