Limiting a part from crossing a border

Yep!
The gray part, it’s supposed to be a Region3 too. Just to make sure it does not gets scaled into the ground. Or do you want it to?

1 Like

I may want it to, but I think I get the general idea. I just have to run the findPartInRegion in each one of those parts and if I find that part that is curretnly being scaled, its out of the plot. and I can set the default perimeter to the amount of parts within the parts folder.

Is there a limit to set parts? Cause this build system is being implimented in a game where people can build entire towers if they’d like, that can be thousands of parts.

Yes, that’s what you should, but about that limit, I think there is a better solution in that case.

Just came up with a new idea. Those parts can just stay there and wait, and you can create a Rotated Region3 with EgoMoose’s module, suggested by me and other people as well. You create it on the part you are scaling, and if that Region3 has any of those red parts in it, then it’s in wrong place.
I am suggesting it because over-usage of Region3 can lag. This is a way to reduce it. Also the limit you said of course.

Let’s say player just scaled a part, in this case you do:

  1. Add all “red parts” into a table.
  2. Create a Rotated Region3 with EgoMoose’s code. You create it with the part that is scaled.
  3. Use FindPartsInRegion3WithWhiteList to find parts in that Region3. Whitelist is the table you created on step 1.
  4. If there is any part that is returned, that’s in the table. That means it exceeds the limit. ABORT MISSION! Part gets back to it’s last size and position, or you alert the player maybe, it’s up to you.

Thanks dude so much! Yeah so the limit can be set to math.huge, but I can understand lag issues. I mean I doubt players would actually scale that many parts at once, but you know.

Anyway great idea, but can you explain the whole um, rotated region 3 more, why do need to use that?

Because part that player is going to scale might be rotated.
And creating a Rotated Region3 is pretty hard, that’s why we suggest a module :slightly_smiling_face:
Also I did not use Rotated Region3 before so can’t explain how to use it, but I know a lot of people who used it and happy with it. I would suggest you to research it, or create another topic for it.

Oh, I understand. Making a region 3 for rotated parts. I will check out the module, thank you for your help.

1 Like