Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

A few questions about Region3?

I just discovered Region3 exists and I think I it's important since I've been using the .Touched event from Parts to define a "region". I can't find much info in roblox docs so here are a few questions:

  1. What "shape" is this region? A block? A sphere?

  2. If it is a block can I make a region3 sphere?

  3. What is min and max in Region3.new( Vector3 min, Vector3 max ) <- taken from https://developer.roblox.com/api-reference/datatype/Region3

  4. How often is this used in a game? (because I haven't used it at all)

5 comments

0
  1. Rectangular Prism. 2) Create a fake sphere that fits inside the region and do some checks to see if the player inside the region is inside the fake sphere using magnitude. 3) min is the lower corner extent, max is the upper corner extent. 4) I can't think of any cases I've seen it used but that doesn't mean you shouldn't use it.
0

for 2) is that a yes or a no?

0

no, they're squares

0

Region3's are usually used in generating fake terrain

0

Ok thanks for all the help

1 answer

  1. A region is a box, as defined by two opposite corners. Imagine how you can click and drag to create a selection box on your desktop, only in three dimensions.

  2. You cannot, however if you find all objects in a region 3, you can use (center.Position - part.Position).Magnitude <= radius to see if it would be in a sphere from the center.

  3. Min and max are the start and end positions of the box, two opposite corners, there's no limit in reasonable use.

  4. It's used in terrain, and for finding parts in an area, but you can do a whole lot without ever touching it.

This discussion is preserved as it was. New answers, comments, and votes are closed.