How to get touching parts

GetTouchingParts() doesnt seem to actually get touching parts
I wanna get the parts that it is colliding with at one time
How can I achieve this?

workspace:GetPartsInPart probably does it.
https://developer.roblox.com/en-us/api-reference/function/WorldRoot/GetPartsInPart

Sample code:

local touchingParts = workspace:GetPartsInPart(workspace.Part)
2 Likes

GetTouchingParts does not return any instances unless the part is collidable, or a Touched event is instated. Personally, when I use this method, I do something like this:

local Interest = part.Touched:Connect(function()end)
local Touching = part:GetTouchingParts()
Interest:Disconnect()

HOWEVER, I suggest using @Lielmaster’s solution, as it more efficient in most circumstances. Unless you have a bias towards GetTouchingParts.

Actually, all parts that are touching the given part will be returned. It should not necessarily be inside the part.

2 Likes

Oh, nice. It even seems like I said exactly what the documentation says :joy: Thank you for pointing that out.

1 Like