Hello,
I am currently trying to use the Terrain:ReplaceMaterial()
function, however when working with Region3
's It starts getting complicated. I find the documentation on the Developer Hub very vague when it comes to Region3
's and scripting terrain in general. Region3 (roblox.com).
They are saying that this is the code to make a Region3 1. local region = Region3.new(Vector3.new(2, 3, 4), Vector3.new(8, 6, 5))
However I don’t understand why there are two Vector3’s and no CFrame
. Then it goes onto saying that if you print region
it should output 1. 5, 4.5, 4.5, 1, 0, 0, 0, 1, 0, 0, 0, 1; 6, 3, 1
They say that the first two numbers are the CFrame
however where are those numbers coming from?
Anyway to move on this is my code I’m having problems with. I don’t know where to put my CFrame
values and where to put my Vector3
values.
First I tried this:
local region = Region3.new()
region.CFrame = CFrame.new(25,0,-1269)
region.Vector3 = Vector3.new(3397,512,1337)
However got the error: CFrame cannot be assigned to
So then I tried this:
local region = Region3.new(Vector3.new(25,0,-1269), Vector3.new(3397,512,1337))
--The upper line means:
--local region = Region3.new(Vector3.new(CFrame), Vector3.new(Vector3))
Then I got the error: (Something allong the lines of) Region3 is too large
Although you might think my error is that the Region 3 is too large I’m able to do the same size zone using the editor.
I hope I can get some help.
Thanks