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

How to create a Region3 and define its Size and CFrame?

This is probably a really stupid question but this is my first time messing around with Region3. Im just trying to create a region 3, by setting its size and CFrame, but for some reason I get the error " Size cannot be assigned to." (my code)

local Region1 = Region3.new()

Region1.Size = TD1.Size
Region1.CFrame = TD1.CFrame

Ive got no clue, and the internet has so far not been helpful, so.

1 comment

0

Maybe include TD1 size and cframe?

1 answer

✓ Accepted answer

I mean, just look at the documentation! Roblox has examples in it too. Just define it and input the minimum and maximum size of it in its parameters.

Look at the following example:

RegionObj = Region3.new(Vector3.new(0,0,0), Vector3.new(50, 50, 50));

You created a new Region3 object and defined the minimum and maximum bounds (aka the minimum and maximum size).

To change its CFrame, just treat it like any other object:

RegionObj.CFrame = CFrame.new(Vector3.new(100, 100, 100)); --Centers at 100, 100, 100 (in respect to X, Y, Z)

The documentation for it can be found here: Roblox Region3

If you have any questions or issues, contact me. ;)

1 comment

0

oh shoot sorry for getting back to you so damn late, this works fine, thanks!

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