Last active
May 11, 2021 11:39
-
-
Save lextoumbourou/b1b29c27b69caf29cc2f9a2e04949734 to your computer and use it in GitHub Desktop.
Create a single Voxel of Terrain in Roblox
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local Terrain = game:GetService("Workspace").Terrain | |
-- The resolution required for Terrain system. | |
local terrainResolution = 4 | |
-- The smallest possible voxel size. | |
local region = Region3.new(Vector3.new(0,0,0), Vector3.new(4,4,4)) | |
-- The material as a 1x1x1 3d-grid. What material should go in the voxel? | |
local material = { | |
{ | |
{Enum.Material.Water} | |
} | |
} | |
-- The occupancy values of the voxel grid. How full should each voxel be? | |
local occupancy = { | |
{ | |
{1} | |
} | |
} | |
Terrain:WriteVoxels(region, terrainResolution, material, occupancy) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment