Ad
Log in to vote
0

How would I make a script that checks if a part is touching nothing?

Asked by 23 days ago

Right now, my script looks like this:

if script.Parent:GetTouchingParts(nil) then

end

But that doesn't work. How would I make it so that it works?

2 answers

Log in to vote
0
Answered by 23 days ago

try to check if the length of the table that GetTouchingParts() is returning is equal to 0:

if #script.Parent:GetTouchingParts() == 0 then

end
0
I will try this poop07393cfhi3n2222 4 — 23d
Ad
Log in to vote
0
Answered by 23 days ago
local IfTouchingPart = script.Parent:GetTouchingParts()

if not IfTouchingPart then
    -- Code if nothing is touching the part
end

Answer this question