okay so here is my question
is there are different event of 2 parts touching each other and 2 parts colliding with each other? if not, how do i find is the part colliding with each other?
1 Like
.Touched fires every time a part touches that part unless CanTouch is turned off
yes i know, what i mean is that a part is IN another part but not only touching it, how do i detect it?
it will still fire if the part is inside another part but if you want to specifically detect when a part is inside another part you should use workspace:GetPartsInPart()
https://create.roblox.com/docs/reference/engine/classes/WorldRoot#GetPartsInPart
Turn on collision on both parts, then you wouldn’t need to care about a part being inside another part.
There’s no separate event for parts intersecting. If you need that, create your own like this:
RunService.Stepped:Connect(function() --don't remember the event that runs after physics processing, oh well
local areIntersecting = arePartsIntersect(partA, partB) --Use GetPartsInPart for this
if areIntersecting and not wereIntersecting then
onPartsIntersecting(partA, partB) --Or fire a BindableEvent
end
wereIntersecting = areIntersecting
end)