You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve?
I want to be able to tell when a part enters and then know when it leaves. -
What is the issue?
Im able to detect when a part enters another part, however, I don’t know how to detect when that part leaves. -
What solutions have you tried so far?
Yes, I googled and couldn’t find anything that would help me.
I am making my own placement system and everything is working, but, I need to detect when a part enters and leaves another part so I can tell if its eligible to place
If you need a better explanation please ask.
A snippet of code from my placement:
local function checkIfInPart(part, baseplate)
local overlapParams = OverlapParams.new()
for i, parts in ipairs(baseplate.Parent.parts:GetDescendants()) do
if parts.Name == "Hitbox" then
for i, v in pairs(workspace:GetPartsInPart(parts, overlapParams)) do
if v ~= parts.Parent and v.Name ~= "Placeholder" then
end
end
end
end
end