Get size of part overlap

Hi. I’m making a system that takes a “negative” part and a “target” part and performs a SubtractAsync().

I want to get the overlap size as mentioned in this post: Getting size of overlapping parts
XKsT2jQ

3 Likes

That post has been anwered. Either way, here’s the solution I think you’re looking for: Part to parts breaker to fit window,door. Just open the place file and copy the code.

Actually, this doesn’t solve the problem I have. I’m not having issues with removing the overlap, as stated above (with SubtractAsync). I want to get the size of the overlap between the two parts that were subtracted.

This should get your overlap, assuming each component of the final vector is the amount of overlap on that respective axis.

local localized = part_b.CFrame:PointToObjectSpace(part_a)
local overlap = part_a.Size + part_b.Size - localized