In this building game, the player can place parts on a plot which can sometimes move out of the plot, like shown in the video. My problem is, how can I detect when a part leaves the plot? Here are possible solutions I’ve already looked at or tried:
-
TouchEnded event, however roblox physics are historically not very good so I don’t want to rely on a touch ended event for this since I’m worried it might miss parts which leave the building region
-
Magnitude checks won’t work since this building region is not spherical
-
Workspace:GetsPartsInPart or similar functions aren’t ideal since each plot could have thousands of parts on it, and looping through each individual part would be slow, plus I’d have to keep repeating this continuously over and over again, and it would probably cause lag
Things contributing to the issue:
-
Looping through all the plot’s parts are difficult since there could be potentially thousands of parts on each of the 12 total slots
-
Ideally it should detect if the corners of an object are not on the plot either, so a huge 500x1x500 part can’t be sticking partially out of the plot. And this would need to work with models as well as parts
Any help is appreciated