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

How to detect part in region without Region3 or Touched?

Asked by
Marios2 360 Moderation Voter
8 years ago

FindPartsInRegion3 is restricted to 100 parts (even ignored ones), and Touched on a part appears to block me from building efficiently in said part which is used as a region.

So i am trying to detect whether or not the part i want to place is within the owned baseplate's borders. The catch: The part can be of any size. This is my last out of many attempts to do this:

if --Other checks
temp.Position.X + (temp.Size.X/2) <= workspace.Baseplates[game.Players.LocalPlayer.Name].Position.X + 128 and 
        temp.Position.X - (temp.Size.X/2) >= workspace.Baseplates[game.Players.LocalPlayer.Name].Position.X - 128 and
        temp.Position.Z + (temp.Size.Z/2) <= workspace.Baseplates[game.Players.LocalPlayer.Name].Position.Z + 128 and
        temp.Position.Z - (temp.Size.Z/2) >= workspace.Baseplates[game.Players.LocalPlayer.Name].Position.Z - 128 then
--my script
end

Important info:

temp = the part to be placed

workspace.Baseplates[game.Players.LocalPlayer.Name] = Player's baseplate

Size of baseplate is 256x2x256 (The height doesn't matter on this case)

Answer this question