Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to detect parts inside parts?

How to detect parts inside parts?

4 comments

0

Do you mean like a smaller size parts inside the part or a children of a part??

0

Do you mean Unions or the part being a child? If the part is a child, use FindFirstChildWhichIsA("Part").

0

I would use a For loop with GetDescendants()

0

This question is too broad and non descriptive.

1 answer

✓ Accepted answer

this is very simple! all you must do is get the part u want then find if any parts r touching it

local table = nil
local part = game.Workspace.Part
table = part:GetTouchingParts()
local part2 = game.Workspace.part2 -- part you want to c if its in this block
if table[part2] then
-- do stuff
end

if u have any question feel free to ask

5 comments

1

It's not inside it, it's simply touching it lol

0

like ur point ^^ but most of the time it will be correct if u wanted exact calculations then u could use region3

0

No need to use region3's

0

GetTouchingParts() is actually a misnomer. It returns the parts that intersect a given part, not parts that whose face are touching a given part, so yes, it will get all parts inside the one the method is called on.

0

help, the spelling, its killing me!

This discussion is preserved as it was. New answers, comments, and votes are closed.