Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-3

How to detect parts inside parts? [closed]

Asked by 6 years ago

How to detect parts inside parts?

0
Do you mean like a smaller size parts inside the part or a children of a part?? User#20388 0 — 6y
0
Do you mean Unions or the part being a child? If the part is a child, use FindFirstChildWhichIsA("Part"). DeceptiveCaster 3761 — 6y
0
I would use a For loop with GetDescendants() MooMooThalahlah 421 — 6y
0
This question is too broad and non descriptive. Le_Teapots 913 — 6y

Closed as Not Constructive by User#20388, DeceptiveCaster, brokenVectors, Axceed_Xlr, and BlackOrange3343

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

1 answer

Log in to vote
1
Answered by 6 years ago
Edited 6 years ago

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

1
It's not inside it, it's simply touching it lol User#20388 0 — 6y
0
like ur point ^^ but most of the time it will be correct if u wanted exact calculations then u could use region3 MRNinjaCreator 95 — 6y
0
No need to use region3's Sir_Melio 221 — 6y
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. Link150 1355 — 6y
0
help, the spelling, its killing me! fanofpixels 718 — 6y
Ad