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!

3 comments

0

You can use part:GetTouchingParts(). GetTouchingParts returns a table of all the things touching a part.

0

If you need more explanation message me/ping me @lucy on the scripting helpers discord i would rather give an in depth explanation

0

Thanks, I'll look into it!