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

How do I detect if an object is touching nothing?

Asked by 5 years ago

I'm new to scripting, so sorry if this is obvious and there's a function or something I don't know that does this. How do I detect if an object is touching nothing? I have a sort of tree generator for my game, and some of them glitch out and spawn in the air. I was thinking I could delete them if they were touching nothing. I couldn't find anything about doing this, so what is something I could try to use? Thanks!

0
You can use part:GetTouchingParts(). GetTouchingParts returns a table of all the things touching a part. royaltoe 5144 — 5y
0
If you need more explanation message me/ping me @lucy on the scripting helpers discord i would rather give an in depth explanation royaltoe 5144 — 5y
0
Thanks, I'll look into it! proqrammed 285 — 5y

Answer this question