Terrain¶
Terrain lets you to create dynamically morphable environments.
Note: Voxel terrain is present; newer terrain material variants are limited.
Description¶
The Terrain class lets you create dynamically morphable environments. It is
based on a 4×4×4 grid of cells, where each cell has a number
between 0 and 1 representing how much the geometry should occupy the cell,
and the material of the cell. The occupancy determines how the cell will morph
together with surrounding cells, and the result is the illusion of having no
grid constraint.
For more information, see Terrain.
Inheritance¶
Object → Instance → PVInstance → BasePart → Terrain
Nova inheritance: Instance → PVInstance → BasePart → Terrain
Properties¶
IsSmooth Supported Property Deprecated Returns true if the game is using the smooth terrain system.
MaxExtents Supported Property Displays the boundaries of the largest possible editable region.
Displays the boundaries of the largest possible editable region.
Displays the boundaries of the largest possible editable region as a
Region3int16. The returned value spans from
(-32000, -32000, -32000) to (32000, 32000, 32000) in cell coordinates,
where each cell is 4 studs wide. This corresponds to a world-space volume
of -128,000 to 128,000 studs on each axis. The property is read-only.
WaterColor Supported Property The tint of Terrain water.
The tint of Terrain water.
The tint color applied to Terrain water. This Color3 value is
blended with the water's base appearance to shift its overall hue. The
default value is [0.05, 0.33, 0.36] (a dark teal).
WaterTransparency Supported Property The transparency of Terrain water.
The transparency of Terrain water.
The transparency of Terrain water, on a scale of 0 (fully opaque) to
1 (fully transparent). The default value is 0.3.
WaterWaveSize Supported Property Sets the maximum height of Terrain water waves in studs.
Sets the maximum height of Terrain water waves in studs. This is
currently constrained to between 0 and 1.
WaterWaveSpeed Supported Property Sets how many times Terrain water waves will move up and down per minute.
Sets how many times Terrain water waves will move up and down per
minute. This is currently constrained to between 0 and 100.
Methods¶
AutowedgeCell Supported Function Deprecated Legacy terrain auto-wedging. Works on non-smooth terrain; no-op on smooth terrain.
Legacy terrain auto-wedging. Works on non-smooth terrain; no-op on smooth terrain.
This is part of the legacy voxel terrain API. Nova returns early on smooth terrain, but the method is still implemented for legacy/non-smooth terrain cells.
AutowedgeCells Supported Function Deprecated Legacy terrain auto-wedging for a region. Works on non-smooth terrain; no-op on smooth terrain.
Legacy terrain auto-wedging for a region. Works on non-smooth terrain; no-op on smooth terrain.
The region variant of the legacy auto-wedge API. Nova still implements it for legacy/non-smooth terrain and returns without work on smooth terrain.
CellCenterToWorld Supported Function Returns the world position of the center of the terrain cell.
Returns the world position of the center of the terrain cell.
Returns the world position of the center of the terrain cell at grid
coordinates (x, y, z). Each terrain cell is 4×4×4 studs, so
this method returns the position of the lower-left-forward corner of the
cell plus an offset of (2, 2, 2) studs.
CellCornerToWorld Supported Function Returns the position of the lower-left-forward corner of the grid cell.
Returns the position of the lower-left-forward corner of the grid cell.
Returns the world position of the lower-left-forward corner of the terrain
cell at grid coordinates (x, y, z). Each terrain cell is
4×4×4 studs, so the corner position is
(x * 4, y * 4, z * 4).
Clear Supported Function Clears all terrain.
Clears all terrain.
Clears the entire terrain, removing all material and occupancy data from
every voxel. After calling this method, the Terrain object contains no
geometry until new terrain is written via methods such as
FillBlock() or
WriteVoxels().
ConvertToSmooth Supported Function Deprecated Converts legacy terrain to smooth terrain. Still implemented for terrain regions.
Converts legacy terrain to smooth terrain. Still implemented for terrain regions.
Modern Roblox says all places use smooth terrain now. Nova still ships the legacy terrain path and implements this conversion for terrain regions.
PluginSecurityCopyRegion Supported Function Stores a chunk of terrain into a TerrainRegion object so it can be loaded back later.
Stores a chunk of terrain into a TerrainRegion object so it can be loaded back later. Note that TerrainRegion data does not replicate between server and client.
CountCells Supported Function Returns the number of non-empty cells in the terrain.
Returns the number of non-empty cells in the terrain.
Returns the approximate number of non-empty cells in the terrain. A cell is considered non-empty when it has a material other than Air and an occupancy greater than zero. This count is an approximation and can be used to quickly gauge how much terrain geometry exists in the place.
FillBall Supported Function Fills a ball of smooth terrain in a given space.
Fills a ball of smooth terrain in a given space.
Fills a spherical volume of smooth terrain centered at center with the
given radius (in studs) and Material. Voxels within the sphere
are set to full occupancy with the specified material. Existing terrain
inside the sphere is overwritten.
Roblox reference signature
FillBlock Supported Function Fills a block of smooth terrain with a given location, rotation, size, and material.
Fills a block of smooth terrain with a given location, rotation, size, and material.
Fills an oriented rectangular volume of smooth terrain at the position and
rotation specified by cframe, with the dimensions given by size (in
studs), using the specified Material. Because the block is oriented
by a CFrame, it can be rotated to any angle. Existing terrain
inside the volume is overwritten.
Roblox reference signature
FillRegion Supported Function Fills a Region3 space with smooth terrain.
Fills a Region3 space with smooth terrain.
Fills an axis-aligned Region3 volume of smooth terrain with the
specified Material at full occupancy. The resolution parameter
must be exactly 4. The region must be aligned to the voxel grid; use
Region3.ExpandToGrid() to align a region before calling.
Roblox reference signature
GetCell Supported Function Deprecated Returns the closest cell material from the legacy terrain engine that matches the smooth terrain voxel specified.
Returns the closest cell material from the legacy terrain engine that matches the smooth terrain voxel specified.
GetWaterCell Supported Function Deprecated Returns true if the cell is a water cell.
Returns true if the cell is a water cell.
PasteRegion Supported Function Applies a chunk of terrain to the Terrain object.
Applies a chunk of terrain to the Terrain object. Note that
TerrainRegion data does not replicate between server and client.
Roblox reference signature
ReadVoxels Supported Function Returns a certain region of smooth terrain in table format.
Returns a certain region of smooth terrain in table format.
Returns the voxel data for a region of smooth terrain as two 3D arrays:
materials (an array of Material values) and occupancies (an
array of numbers between 0 and 1). The region must be aligned to the
voxel grid, resolution must be 4, and the region cannot exceed
4,194,304 voxels. For more granular channel control, see
ReadVoxelChannels().
SetCell Supported Function Deprecated Sets the occupancy and material of a specific terrain voxel.
Terrain:SetCell(int x, int y, int z, CellMaterial material, CellBlock block, CellOrientation orientation)
Sets the occupancy and material of a specific terrain voxel.
Sets the occupancy of the specified terrain voxel to 1 and sets its
material to the closest smooth terrain material that matches the cell
material.
Roblox reference signature
SetCells Supported Function Deprecated Sets the occupancy and material of all terrain voxels in a specific region.
Terrain:SetCells(Region3int16 region, CellMaterial material, CellBlock block, CellOrientation orientation)
Sets the occupancy and material of all terrain voxels in a specific region.
Sets the occupancy of all terrain voxels in the specified region to 1
and sets their materials to the closest smooth terrain material that
matches the cell material.
Roblox reference signature
SetWaterCell Supported Function Deprecated Sets the specified terrain voxel's material to water and sets its occupancy to 1.
Sets the specified terrain voxel's material to water and sets its
occupancy to 1.
Roblox reference signature
WorldToCell Supported Function Returns the grid cell location that contains the position point.
Returns the grid cell location that contains the position point.
Returns the grid cell location that contains the point position.
WorldToCellPreferEmpty Supported Function Returns the grid cell location that contains the position point, preferring empty grid cells when position is on a grid edge.
Returns the grid cell location that contains the position point, preferring empty grid cells when position is on a grid edge.
Returns the grid cell location that contains the point position,
preferring empty grid cells when position is on a grid edge.
WorldToCellPreferSolid Supported Function Returns the grid cell location that contains the point position, preferring non-empty grid cells when position is on a grid edge.
Returns the grid cell location that contains the point position, preferring non-empty grid cells when position is on a grid edge.
WriteVoxels Supported Function Sets a certain region of smooth terrain using table format.
Sets a certain region of smooth terrain using table format.
Sets a region of smooth terrain from two 3D arrays: materials (an array
of Material values) and occupancy (an array of numbers between
0 and 1). Both arrays must have dimensions that exactly match the
target region in voxels. The region must be aligned to the voxel grid,
resolution must be 4, and the region cannot exceed 4,194,304 voxels.
For more granular channel control, see
WriteVoxelChannels().
Roblox reference signature
Inherited members¶
Inherited from BasePart: 65 properties, 54 methods, 13 events. They are documented on the base class page.
37 modern Roblox member(s) are not implemented yet — expand to inspect
Members declared by Roblox's Terrain class (or by a missing base class) that Nova does not expose. Use this list to scope a migration; the compatibility guide has the recommended workaround.
Properties¶
| Member | Signature | Status | Notes | Flags |
|---|---|---|---|---|
WaterReflectance |
WaterReflectance: float |
Not yet | Controls how opaque Terrain water reflections are. |
— |
Methods¶
| Member | Signature | Status | Notes | Flags |
|---|---|---|---|---|
CanSmoothVoxelsBeUpgraded |
Terrain:CanSmoothVoxelsBeUpgraded(): bool |
Not yet | — | RobloxScriptSecurity |
ClearVoxelsAsync_beta |
Terrain:ClearVoxelsAsync_beta(region: Region3, channelIds: Array): null |
Not yet | — | CustomLuaState |
CreateVoxelBuffer_beta |
Terrain:CreateVoxelBuffer_beta(): VoxelBuffer |
Not yet | — | RobloxScriptSecurity |
DrawBufferAsync |
Terrain:DrawBufferAsync(cframe: CFrame, scale: float, resolution: int, source: VoxelBuffer, mergeConfig: Dictionary): null |
Not yet | — | Yields, RobloxScriptSecurity |
FillBallSlot |
Terrain:FillBallSlot(center: Vector3, radius: float, solidMaterialIndex: int): null |
Not yet | — | RobloxScriptSecurity |
FillBlockSlot |
Terrain:FillBlockSlot(cframe: CFrame, size: Vector3, solidMaterialIndex: int): null |
Not yet | — | RobloxScriptSecurity |
FillCylinder |
Terrain:FillCylinder(cframe: CFrame, height: float, radius: float, material: Material): null |
Not yet | Fills a cylinder of smooth terrain in a given space. | — |
FillCylinderSlot |
Terrain:FillCylinderSlot(cframe: CFrame, height: float, radius: float, solidMaterialIndex: int): null |
Not yet | — | RobloxScriptSecurity |
FillRegionSlot |
Terrain:FillRegionSlot(region: Region3, resolution: float, solidMaterialIndex: int): null |
Not yet | — | RobloxScriptSecurity |
FillWedge |
Terrain:FillWedge(cframe: CFrame, size: Vector3, material: Material): null |
Not yet | Fills a wedge-shaped volume of terrain with the given Material. | — |
FillWedgeSlot |
Terrain:FillWedgeSlot(cframe: CFrame, size: Vector3, solidMaterialIndex: int): null |
Not yet | — | RobloxScriptSecurity |
GenerateWaterFlowMap |
Terrain:GenerateWaterFlowMap(generateFoam: bool): null |
Not yet | — | RobloxScriptSecurity |
GetMaterialColor |
Terrain:GetMaterialColor(material: Material): Color3 |
Not yet | Returns current terrain material color for specified terrain material. | — |
GetMaterialSlot |
Terrain:GetMaterialSlot(slotIndex: int): Tuple |
Not yet | — | — |
GetTerrainWireframe |
Terrain:GetTerrainWireframe(cframe: CFrame, size: Vector3): Array |
Not yet | — | RobloxScriptSecurity |
IterateVoxelsAsync_beta |
Terrain:IterateVoxelsAsync_beta(region: Region3, resolution: int, channelIds: Array): TerrainIterateOperation |
Not yet | — | CustomLuaState |
ModifyVoxelsAsync_beta |
Terrain:ModifyVoxelsAsync_beta(region: Region3, resolution: int, channelIds: Array): TerrainModifyOperation |
Not yet | — | CustomLuaState |
ReadBufferAsync |
Terrain:ReadBufferAsync(region: Region3, resolution: int): VoxelBuffer |
Not yet | — | Yields, RobloxScriptSecurity |
ReadVoxelChannels |
Terrain:ReadVoxelChannels(region: Region3, resolution: float, channelIds: Array): Dictionary |
Not yet | Returns a region of terrain voxel data in table format based on the channel names. | CustomLuaState |
ReadVoxelsAsync_beta |
Terrain:ReadVoxelsAsync_beta(region: Region3, resolution: int, channelIds: Array): TerrainReadOperation |
Not yet | — | CustomLuaState |
ReplaceMaterial |
Terrain:ReplaceMaterial(region: Region3, resolution: float, sourceMaterial: Material, targetMaterial: Material): null |
Not yet | Replaces the terrain of a material within a region with another material. | — |
ReplaceMaterialInTransform |
Terrain:ReplaceMaterialInTransform(cframe: CFrame, size: Vector3, sourceMaterial: Material, targetMaterial: Material): null |
Not yet | — | RobloxScriptSecurity |
ReplaceMaterialInTransformSubregion |
Terrain:ReplaceMaterialInTransformSubregion(cframe: CFrame, size: Vector3, sourceMaterial: Material, targetMaterial: Material, targetRegion: Region3int16): null |
Not yet | — | RobloxScriptSecurity |
ReplaceMaterialInTransformSubregionSlot |
Terrain:ReplaceMaterialInTransformSubregionSlot(cframe: CFrame, size: Vector3, sourceMaterialIndex: int, targetMaterialIndex: int, targetRegion: Region3int16): null |
Not yet | — | RobloxScriptSecurity |
ResetMaterialSlot |
Terrain:ResetMaterialSlot(slotIndex: int): null |
Not yet | — | — |
ResetWaterFlowMap |
Terrain:ResetWaterFlowMap(): null |
Not yet | — | RobloxScriptSecurity |
SetMaterialColor |
Terrain:SetMaterialColor(material: Material, value: Color3): null |
Not yet | Sets current terrain material color for specified terrain material. | — |
SetMaterialInTransform |
Terrain:SetMaterialInTransform(cframe: CFrame, size: Vector3, targetMaterial: Material): null |
Not yet | — | RobloxScriptSecurity |
SetMaterialInTransformSubregion |
Terrain:SetMaterialInTransformSubregion(cframe: CFrame, size: Vector3, targetMaterial: Material, targetRegion: Region3int16): null |
Not yet | — | RobloxScriptSecurity |
SetMaterialInTransformSubregionSlot |
Terrain:SetMaterialInTransformSubregionSlot(cframe: CFrame, size: Vector3, targetMaterialIndex: int, targetRegion: Region3int16): null |
Not yet | — | RobloxScriptSecurity |
SetMaterialSlot |
Terrain:SetMaterialSlot(slotIndex: int, baseMaterial: Material, materialVariant: string, color: Color3): null |
Not yet | — | — |
SmoothRegion |
Terrain:SmoothRegion(region: Region3, resolution: float, strength: float): Tuple |
Not yet | — | CustomLuaState, RobloxScriptSecurity |
SmoothRegionMaterialSlots |
Terrain:SmoothRegionMaterialSlots(region: Region3, resolution: float, strength: float): Tuple |
Not yet | — | CustomLuaState, RobloxScriptSecurity |
WriteVoxelChannels |
Terrain:WriteVoxelChannels(region: Region3, resolution: float, channels: Dictionary): null |
Not yet | Sets a region of terrain using a dictionary of voxel channel data. | CustomLuaState |
WriteVoxelsAsync_beta |
Terrain:WriteVoxelsAsync_beta(region: Region3, resolution: int, channelIds: Array): TerrainWriteOperation |
Not yet | — | CustomLuaState |
Events¶
| Member | Signature | Status | Notes | Flags |
|---|---|---|---|---|
GridBackendReloadRequired |
GridBackendReloadRequired(wouldUseNewGrid: bool) |
Not yet | — | RobloxScriptSecurity |
Roblox reference: Terrain
Generated from Nova's API dump and Roblox creator-docs. Nova-only members come from the engine's reflection metadata.