Reference API Roblox

Engine API

Website

Related

Reference API Roblox

Terrain

Terrain lets you to create dynamically morphable environments.

This class is not creatable. Instances of this class cannot be created with Instance.new.
Tags: [NotCreatable]

Member index 73

HistoryMember
731Decoration: bool
731GrassLength: float
731IsSmooth: bool
486MaterialColors: BinaryString
731MaxExtents: Region3int16
731WaterColor: Color3
731WaterReflectance: float
731WaterTransparency: float
731WaterWaveSize: float
731WaterWaveSpeed: float
462AutowedgeCell(x: int, y: int, z: int): bool
573AutowedgeCells(region: Region3int16): null
560CanSmoothVoxelsBeUpgraded(): bool
462CellCenterToWorld(x: int, y: int, z: int): Vector3
462CellCornerToWorld(x: int, y: int, z: int): Vector3
573Clear(): null
675ClearVoxelsAsync_beta(region: Region3, channelIds: Array): null
573ConvertToSmooth(): null
498CopyRegion(region: Region3int16): TerrainRegion
462CountCells(): int
710CreateVoxelBuffer_beta(): VoxelBuffer
710DrawBufferAsync(cframe: CFrame, scale: float, resolution: int, source: VoxelBuffer, mergeConfig: Dictionary): null
573FillBall(center: Vector3, radius: float, material: Material): null
731FillBallSlot(center: Vector3, radius: float, solidMaterialIndex: int): null
573FillBlock(cframe: CFrame, size: Vector3, material: Material): null
731FillBlockSlot(cframe: CFrame, size: Vector3, solidMaterialIndex: int): null
573FillCylinder(cframe: CFrame, height: float, radius: float, material: Material): null
731FillCylinderSlot(cframe: CFrame, height: float, radius: float, solidMaterialIndex: int): null
573FillRegion(region: Region3, resolution: float, material: Material): null
731FillRegionSlot(region: Region3, resolution: float, solidMaterialIndex: int): null
573FillWedge(cframe: CFrame, size: Vector3, material: Material): null
731FillWedgeSlot(cframe: CFrame, size: Vector3, solidMaterialIndex: int): null
462GetCell(x: int, y: int, z: int): Tuple
567GetMaterialColor(material: Material): Color3
719GetMaterialSlot(slotIndex: int): Tuple
565GetTerrainWireframe(cframe: CFrame, size: Vector3): Array
462GetWaterCell(x: int, y: int, z: int): Tuple
675IterateVoxelsAsync_beta(region: Region3, resolution: int, channelIds: Array): TerrainIterateOperation
675ModifyVoxelsAsync_beta(region: Region3, resolution: int, channelIds: Array): TerrainModifyOperation
573PasteRegion(region: TerrainRegion, corner: Vector3int16, pasteEmptyCells: bool): null
710ReadBufferAsync(region: Region3, resolution: int): VoxelBuffer
616ReadVoxelChannels(region: Region3, resolution: float, channelIds: Array): Dictionary
486ReadVoxels(region: Region3, resolution: float): Tuple
675ReadVoxelsAsync_beta(region: Region3, resolution: int, channelIds: Array): TerrainReadOperation
573ReplaceMaterial(region: Region3, resolution: float, sourceMaterial: Material, targetMaterial: Material): null
573ReplaceMaterialInTransform(cframe: CFrame, size: Vector3, sourceMaterial: Material, targetMaterial: Material): null
582ReplaceMaterialInTransformSubregion(cframe: CFrame, size: Vector3, sourceMaterial: Material, targetMaterial: Material, targetRegion: Region3int16): null
719ResetMaterialSlot(slotIndex: int): null
573SetCell(x: int, y: int, z: int, material: CellMaterial, block: CellBlock, orientation: CellOrientation): null
573SetCells(region: Region3int16, material: CellMaterial, block: CellBlock, orientation: CellOrientation): null
573SetMaterialColor(material: Material, value: Color3): null
573SetMaterialInTransform(cframe: CFrame, size: Vector3, targetMaterial: Material): null
582SetMaterialInTransformSubregion(cframe: CFrame, size: Vector3, targetMaterial: Material, targetRegion: Region3int16): null
719SetMaterialSlot(slotIndex: int, baseMaterial: Material, materialVariant: string, color: Color3): null
573SetWaterCell(x: int, y: int, z: int, force: WaterForce, direction: WaterDirection): null
569SmoothRegion(region: Region3, resolution: float, strength: float): Tuple
462WorldToCell(position: Vector3): Vector3
462WorldToCellPreferEmpty(position: Vector3): Vector3
462WorldToCellPreferSolid(position: Vector3): Vector3
616WriteVoxelChannels(region: Region3, resolution: float, channels: Dictionary): null
573WriteVoxels(region: Region3, resolution: float, materials: Array, occupancy: Array): null
675WriteVoxelsAsync_beta(region: Region3, resolution: int, channelIds: Array): TerrainWriteOperation
inherited from BasePart
731Anchored: bool
731AssemblyAngularVelocity: Vector3
731AssemblyCenterOfMass: Vector3
731AssemblyLinearVelocity: Vector3
731AssemblyMass: float
731AssemblyRootPart: BasePart
731AudioCanCollide: bool
731BackSurface: SurfaceType
731BottomSurface: SurfaceType
731BrickColor: BrickColor
731CFrame: CFrame
731CanCollide: bool
731CanQuery: bool
731CanTouch: bool
731CastShadow: bool
731CenterOfMass: Vector3
731CollisionGroup: string
731CollisionGroupId: int
731Color: Color3
731CurrentPhysicalProperties: PhysicalProperties
731CustomPhysicalProperties: PhysicalProperties
731EnableFluidForces: bool
731ExtentsCFrame: CFrame
731ExtentsSize: Vector3
731FrontSurface: SurfaceType
731LeftSurface: SurfaceType
731Locked: bool
731Mass: float
731Massless: bool
731Material: Material
731MaterialVariant: string
731PivotOffset: CFrame
731Reflectance: float
731ResizeIncrement: int
731ResizeableFaces: Faces
731RightSurface: SurfaceType
731RootPriority: int
731Rotation: Vector3
731Size: Vector3
731SpecificGravity: float
731TopSurface: SurfaceType
731Transparency: float
731brickColor: BrickColor
603AngularAccelerationToTorque(angAcceleration: Vector3, angVelocity: Vector3 = 0, 0, 0): Vector3
573ApplyAngularImpulse(impulse: Vector3): null
573ApplyImpulse(impulse: Vector3): null
573ApplyImpulseAtPosition(impulse: Vector3, position: Vector3): null
733BindToCollisionSummaries(callback: Function): RBXScriptConnection
573BreakJoints(): null
557CanCollideWith(part: BasePart): bool
462CanSetNetworkOwnership(): Tuple
576GetClosestPointOnSurface(position: Vector3): Vector3
648GetConnectedParts(recursive: bool = false): Instances
648GetJoints(): Instances
486GetMass(): float
567GetNetworkOwner(): Instance
567GetNetworkOwnershipAuto(): bool
648GetNoCollisionConstraints(): Instances
678GetPhysicsCost(): float
462GetRenderCFrame(): CFrame
731GetRootPart(): Instance
648GetTouchingParts(): Instances
557GetVelocityAtPosition(position: Vector3): Vector3
648IntersectAsync(parts: Instances, collisionfidelity: CollisionFidelity = Default, renderFidelity: RenderFidelity = Automatic): Instance
486IsGrounded(): bool
573MakeJoints(): null
462Resize(normalId: NormalId, deltaAmount: int): bool
573SetNetworkOwner(playerInstance: Player = Player): null
573SetNetworkOwnershipAuto(): null
648SubtractAsync(parts: Instances, collisionfidelity: CollisionFidelity = Default, renderFidelity: RenderFidelity = Automatic): Instance
603TorqueToAngularAcceleration(torque: Vector3, angVelocity: Vector3 = 0, 0, 0): Vector3
648UnionAsync(parts: Instances, collisionfidelity: CollisionFidelity = Default, renderFidelity: RenderFidelity = Automatic): Instance
731breakJoints(): null
731getMass(): float
573makeJoints(): null
731resize(normalId: NormalId, deltaAmount: int): bool
483LocalSimulationTouched(part: BasePart)
462OutfitChanged()
731StoppedTouching(otherPart: BasePart)
483TouchEnded(otherPart: BasePart)
483Touched(otherPart: BasePart)
inherited from PVInstance
731Origin: CFrame
731Pivot Offset: CFrame
576GetPivot(): CFrame
573PivotTo(targetCFrame: CFrame): null
inherited from Instance
731Archivable: bool
731Capabilities: SecurityCapabilities
731IsInSandbox: bool
731Name: string
731Parent: Instance
731PredictionMode: PredictionMode
731Sandboxed: bool
731UniqueId: UniqueId
576AddTag(tag: string): null
573ClearAllChildren(): null
462Clone(): Instance
573Destroy(): null
486FindFirstAncestor(name: string): Instance
486FindFirstAncestorOfClass(className: string): Instance
486FindFirstAncestorWhichIsA(className: string): Instance
486FindFirstChild(name: string, recursive: bool = false): Instance
486FindFirstChildOfClass(className: string): Instance
486FindFirstChildWhichIsA(className: string, recursive: bool = false): Instance
486FindFirstDescendant(name: string): Instance
563GetActor(): Actor
486GetAttribute(attribute: string): Variant
462GetAttributeChangedSignal(attribute: string): RBXScriptSignal
631GetAttributes(): Dictionary
648GetChildren(): Instances
462GetDebugId(scopeLength: int = 4): string
707GetDescendants(): Instances
486GetFullName(): string
706GetStyled(name: string, selector: string?): Variant
657GetStyledPropertyChangedSignal(property: string): RBXScriptSignal
576GetTags(): Array
576HasTag(tag: string): bool
486IsAncestorOf(descendant: Instance): bool
486IsDescendantOf(ancestor: Instance): bool
664IsPropertyModified(property: string): bool
698QueryDescendants(selector: string): Instances
573Remove(): null
576RemoveTag(tag: string): null
664ResetPropertyToDefault(property: string): null
573SetAttribute(attribute: string, value: Variant): null
462WaitForChild(childName: string, timeOut: double): Instance
731children(): Instances
731clone(): Instance
731destroy(): null
731findFirstChild(name: string, recursive: bool = false): Instance
731getChildren(): Instances
731isDescendantOf(ancestor: Instance): bool
731remove(): null
462AncestryChanged(child: Instance, parent: Instance)
462AttributeChanged(attribute: string)
462ChildAdded(child: Instance)
462ChildRemoved(child: Instance)
462DescendantAdded(descendant: Instance)
462DescendantRemoving(descendant: Instance)
500Destroying()
657StyledPropertiesChanged()
731childAdded(child: Instance)
inherited from Object
731ClassName: string
731className: string
647GetPropertyChangedSignal(property: string): RBXScriptSignal
647IsA(className: string): bool
731isA(className: string): bool
647Changed(property: string)

Removed member index 39

HistoryMember
67Anchored: bool
67Archivable: bool
67BrickColor: BrickColor
67CFrame: CoordinateFrame
67CanCollide: bool
67Elasticity: float
67Friction: float
67Locked: bool
67Material: Material
67Name: string
67Position: Vector3
67Reflectance: float
67RotVelocity: Vector3
67Transparency: float
67Velocity: Vector3
67BreakJoints(): void
668CanShorelinesBeUpgraded(): bool
484CancelImportHeightmap(): void
67Clone(): Instance
67Destroy(): void
725GetBaseMaterialSlotIndex(baseMaterial: Material): int?
725GetFirstCustomMaterialSlotIndex(): int
565HideTerrainRegion(): void
462ImportHeightMap(heightMapBinary: string, colorMapBinary: string, region: Region3): void
484ImportHeightmap(region: Region3, heightmapAssetId: Content, colormapAssetId: Content, defaultMaterial: Material): void
67MakeJoints(): void
67Resize(normalId: NormalId, deltaAmount: int): bool
484SetImportHeightmapPaused(paused: bool): void
565SetTerrainRegion(cframe: CFrame, size: Vector3): void
565SetWireframeRegion(cframe: CFrame, size: Vector3): void
565ShowTerrainRegion(): void
67breakJoints(): void
67clone(): Instance
67destroy(): void
67makeJoints(): void
67resize(normalId: NormalId, deltaAmount: int): bool
484TerrainProgressUpdate(progressRatio: float)

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.

History 323

Members 73

AutowedgeCell

Parameters (3)
xint
yint
zint
Returns (1)
bool

Obsolete function which no longer does anything.

This function is deprecated. It exists only for backward compatibility, and should not be used for new work.

History 5

Tags: [Deprecated]

AutowedgeCells

Parameters (1)
regionRegion3int16
Returns (1)
null

Obsolete function which no longer does anything. It was part of the legacy terrain engine that has since been removed, so calling it on a region has no effect.

This function is deprecated. It exists only for backward compatibility, and should not be used for new work.

History 6

Tags: [Deprecated]

CanSmoothVoxelsBeUpgraded

Parameters (0)
No parameters.
Returns (1)
bool

History 1

CellCenterToWorld

Parameters (3)
xint
yint
zint
Returns (1)
Vector3

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.

History 2

CellCornerToWorld

Parameters (3)
xint
yint
zint
Returns (1)
Vector3

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).

History 2

Clear

Parameters (0)
No parameters.
Returns (1)
null

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().

History 3

ClearVoxelsAsync_beta

Parameters (2)
regionRegion3
channelIdsArray
Returns (1)
null
This function has a custom internal state. It may behave in a non-standard way.

History 1

Tags: [CustomLuaState]

ConvertToSmooth

Parameters (0)
No parameters.
Returns (1)
null

Transforms the legacy terrain engine into the new terrain engine. All places now automatically use the new terrain engine, so this method is obsolete.

This function is deprecated. It exists only for backward compatibility, and should not be used for new work.

History 4

Tags: [Deprecated]

CopyRegion

Parameters (1)
regionRegion3int16
Returns (1)
TerrainRegion

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.

History 3

CountCells

Parameters (0)
No parameters.
Returns (1)
int

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.

History 2

CreateVoxelBuffer_beta

Parameters (0)
No parameters.
Returns (1)
VoxelBuffer

History 1

Decoration

TypeDefault
boolfalse

Currently enables or disables animated grass on the Grass terrain material, although future modifications of this property may control additional decorative features.

This property is not scriptable. It cannot be accessed by script code.

History 6

Tags: [NotScriptable]

DrawBufferAsync

Parameters (5)
cframeCFrame
scalefloat
resolutionint
sourceVoxelBuffer
mergeConfigDictionary
Returns (1)
null
This function yields. It will block the calling thread until completion.

History 1

Tags: [Yields]

FillBall

Parameters (3)
centerVector3
radiusfloat
materialMaterial
Returns (1)
null

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.

History 3

FillBallSlot

Parameters (3)
centerVector3
radiusfloat
solidMaterialIndexint
Returns (1)
null

History 1

FillBlock

Parameters (3)
cframeCFrame
sizeVector3
materialMaterial
Returns (1)
null

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.

History 3

FillBlockSlot

Parameters (3)
cframeCFrame
sizeVector3
solidMaterialIndexint
Returns (1)
null

History 1

FillCylinder

Parameters (4)
cframeCFrame
heightfloat
radiusfloat
materialMaterial
Returns (1)
null

Fills a cylinder of smooth terrain in a given space. The space is defined using a CFrame, height, and radius.

History 3

FillCylinderSlot

Parameters (4)
cframeCFrame
heightfloat
radiusfloat
solidMaterialIndexint
Returns (1)
null

History 1

FillRegion

Parameters (3)
regionRegion3
resolutionfloat
materialMaterial
Returns (1)
null

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.

History 3

FillRegionSlot

Parameters (3)
regionRegion3
resolutionfloat
solidMaterialIndexint
Returns (1)
null

History 1

FillWedge

Parameters (3)
cframeCFrame
sizeVector3
materialMaterial
Returns (1)
null

This method fills a wedge-shaped volume of Terrain with the given Material and the area's CFrame and size. The orientation of the wedge is the same as an equivalent WedgePart.

History 3

FillWedgeSlot

Parameters (3)
cframeCFrame
sizeVector3
solidMaterialIndexint
Returns (1)
null

History 1

GetCell

Parameters (3)
xint
yint
zint
Returns (1)
Tuple

Returns the closest cell material from the legacy terrain engine that matches the smooth terrain voxel specified.

This function is deprecated. It exists only for backward compatibility, and should not be used for new work.

History 5

Tags: [Deprecated]

GetMaterialColor

Parameters (1)
materialMaterial
Returns (1)
Color3

Returns the current Color3 color for the specified terrain Material. This color represents the tint applied to the material's base texture. Passing Air or Water throws an error because those materials do not support custom colors.

History 3

GetMaterialSlot

Parameters (1)
slotIndexint
Returns (1)
Tuple

History 1

GetTerrainWireframe

Parameters (2)
cframeCFrame
sizeVector3
Returns (1)
Array

History 1

GetWaterCell

Parameters (3)
xint
yint
zint
Returns (1)
Tuple

Returns true if the cell is a water cell.

This function is deprecated. It exists only for backward compatibility, and should not be used for new work.

History 8

Tags: [Deprecated]

GrassLength

TypeDefault
float0.699999988

Specifies the length of animated grass on the Grass terrain material, assuming Decoration is enabled. Valid values are between 0.1 and 1.

This property is not scriptable. It cannot be accessed by script code.

History 4

Tags: [NotScriptable]

IsSmooth

TypeDefault
booltrue

Returns true if the game is using the smooth terrain system.

This property is deprecated. It exists only for backward compatibility, and should not be used for new work.
This property is not replicated. Its interface does not cross the network boundary.
This property is read-only. Its value can be read, but it cannot be modified.

History 7

Tags: [ReadOnly, NotReplicated, Deprecated]

IterateVoxelsAsync_beta

Parameters (3)
regionRegion3
resolutionint
channelIdsArray
Returns (1)
TerrainIterateOperation
This function has a custom internal state. It may behave in a non-standard way.

History 1

Tags: [CustomLuaState]

MaterialColors

TypeDefault
BinaryString

MaterialColors represents the editor for the Material Color feature and cannot be edited by scripts.

To get the color of a material, use Terrain:GetMaterialColor(). To set the color of a material, use Terrain:SetMaterialColor().

This property is not scriptable. It cannot be accessed by script code.

History 3

Tags: [NotScriptable]

MaxExtents

TypeDefault
Region3int16

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.

This property is not replicated. Its interface does not cross the network boundary.
This property is read-only. Its value can be read, but it cannot be modified.

History 6

Tags: [ReadOnly, NotReplicated]

ModifyVoxelsAsync_beta

Parameters (3)
regionRegion3
resolutionint
channelIdsArray
Returns (1)
TerrainModifyOperation
This function has a custom internal state. It may behave in a non-standard way.

History 1

Tags: [CustomLuaState]

PasteRegion

Parameters (3)
regionTerrainRegion
cornerVector3int16
pasteEmptyCellsbool
Returns (1)
null

Applies a chunk of terrain to the Terrain object. Note that TerrainRegion data does not replicate between server and client.

History 4

ReadBufferAsync

Parameters (2)
regionRegion3
resolutionint
Returns (1)
VoxelBuffer
This function yields. It will block the calling thread until completion.

History 1

Tags: [Yields]

ReadVoxelChannels

Parameters (3)
regionRegion3
resolutionfloat
channelIdsArray
Returns (1)
Dictionary

Returns voxel data from a region of terrain, separated by channel. Unlike ReadVoxels(), this method lets you specify exactly which channels to read (SolidMaterial, SolidOccupancy, and/or LiquidOccupancy), and returns a dictionary keyed by channel ID. The region must be aligned to the voxel grid, resolution must be 4, and the region cannot exceed 4,194,304 voxels.

This function has a custom internal state. It may behave in a non-standard way.

History 4

Tags: [CustomLuaState]

ReadVoxels

Parameters (2)
regionRegion3
resolutionfloat
Returns (1)
Tuple

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().

This function has a custom internal state. It may behave in a non-standard way.

History 4

Tags: [CustomLuaState]

ReadVoxelsAsync_beta

Parameters (3)
regionRegion3
resolutionint
channelIdsArray
Returns (1)
TerrainReadOperation
This function has a custom internal state. It may behave in a non-standard way.

History 1

Tags: [CustomLuaState]

ReplaceMaterial

Parameters (4)
regionRegion3
resolutionfloat
sourceMaterialMaterial
targetMaterialMaterial
Returns (1)
null

ReplaceMaterial replaces terrain of a certain Material within a Region3 with another material. Essentially, it is a find-and-replace operation on Terrain materials.

When calling this method, the resolution parameter must be exactly 4. Additionally, region must be aligned to the terrain materials grid, such that the components of the region's minimum and maximum points must be divisible by 4. Use Region3:ExpandToGrid() to make a region compatible with this function.

History 3

ReplaceMaterialInTransform

Parameters (4)
cframeCFrame
sizeVector3
sourceMaterialMaterial
targetMaterialMaterial
Returns (1)
null

History 2

ReplaceMaterialInTransformSubregion

Parameters (5)
cframeCFrame
sizeVector3
sourceMaterialMaterial
targetMaterialMaterial
targetRegionRegion3int16
Returns (1)
null

History 1

ResetMaterialSlot

Parameters (1)
slotIndexint
Returns (1)
null

History 1

SetCell

Parameters (6)
xint
yint
zint
materialCellMaterial
blockCellBlock
orientationCellOrientation
Returns (1)
null

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.

This function is deprecated. It exists only for backward compatibility, and should not be used for new work.

History 6

Tags: [Deprecated]

SetCells

Parameters (4)
regionRegion3int16
materialCellMaterial
blockCellBlock
orientationCellOrientation
Returns (1)
null

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.

This function is deprecated. It exists only for backward compatibility, and should not be used for new work.

History 6

Tags: [Deprecated]

SetMaterialColor

Parameters (2)
materialMaterial
valueColor3
Returns (1)
null

Sets current terrain material color for specified terrain material. Terrain material will shift its base color toward specified color.

History 3

SetMaterialInTransform

Parameters (3)
cframeCFrame
sizeVector3
targetMaterialMaterial
Returns (1)
null

History 2

SetMaterialInTransformSubregion

Parameters (4)
cframeCFrame
sizeVector3
targetMaterialMaterial
targetRegionRegion3int16
Returns (1)
null

History 1

SetMaterialSlot

Parameters (4)
slotIndexint
baseMaterialMaterial
materialVariantstring
colorColor3
Returns (1)
null

History 1

SetWaterCell

Parameters (5)
xint
yint
zint
forceWaterForce
directionWaterDirection
Returns (1)
null

Sets the specified terrain voxel's material to water and sets its occupancy to 1.

This function is deprecated. It exists only for backward compatibility, and should not be used for new work.

History 9

Tags: [Deprecated]

SmoothRegion

Parameters (3)
regionRegion3
resolutionfloat
strengthfloat
Returns (1)
Tuple
This function has a custom internal state. It may behave in a non-standard way.

History 1

Tags: [CustomLuaState]

WaterColor

TypeDefault
Color30.05, 0.33, 0.36

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).

History 8

WaterReflectance

TypeDefault
float1

Controls how opaque the reflections on Terrain water are, on a scale of 0 (no reflections) to 1 (fully opaque reflections). The default value is 1.

History 6

WaterTransparency

TypeDefault
float0.300000012

The transparency of Terrain water, on a scale of 0 (fully opaque) to 1 (fully transparent). The default value is 0.3.

History 8

WaterWaveSize

TypeDefault
float0.150000006

Sets the maximum height of Terrain water waves in studs. This is currently constrained to between 0 and 1.

History 8

WaterWaveSpeed

TypeDefault
float10

Sets how many times Terrain water waves will move up and down per minute. This is currently constrained to between 0 and 100.

History 8

WorldToCell

Parameters (1)
positionVector3
Returns (1)
Vector3

Returns the grid cell location that contains the point position.

History 2

WorldToCellPreferEmpty

Parameters (1)
positionVector3
Returns (1)
Vector3

Returns the grid cell location that contains the point position, preferring empty grid cells when position is on a grid edge.

History 2

WorldToCellPreferSolid

Parameters (1)
positionVector3
Returns (1)
Vector3

Returns the grid cell location that contains the point position, preferring non-empty grid cells when position is on a grid edge.

History 2

WriteVoxelChannels

Parameters (3)
regionRegion3
resolutionfloat
channelsDictionary
Returns (1)
null

Sets a region of terrain using a dictionary of per-channel voxel data, the inverse of ReadVoxelChannels(). The channels dictionary maps channel ID strings (SolidMaterial, SolidOccupancy, and/or LiquidOccupancy) to their respective 3D data arrays. You may write one or more channels in a single call. The region must be aligned to the voxel grid, resolution must be 4, and the region cannot exceed 4,194,304 voxels.

This function has a custom internal state. It may behave in a non-standard way.

History 4

Tags: [CustomLuaState]

WriteVoxels

Parameters (4)
regionRegion3
resolutionfloat
materialsArray
occupancyArray
Returns (1)
null

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().

This function has a custom internal state. It may behave in a non-standard way.

History 4

Tags: [CustomLuaState]

WriteVoxelsAsync_beta

Parameters (3)
regionRegion3
resolutionint
channelIdsArray
Returns (1)
TerrainWriteOperation
This function has a custom internal state. It may behave in a non-standard way.

History 1

Tags: [CustomLuaState]

Removed members 39

Anchored

TypeDefault
bool
This property is deprecated. It exists only for backward compatibility, and should not be used for new work.

History 2

Tags: [Deprecated]

Archivable

TypeDefault
bool
This property is deprecated. It exists only for backward compatibility, and should not be used for new work.

History 2

Tags: [Deprecated]

BreakJoints

Parameters (0)
No parameters.
Returns (1)
void
This function is deprecated. It exists only for backward compatibility, and should not be used for new work.

History 2

Tags: [Deprecated]

BrickColor

TypeDefault
BrickColor
This property is deprecated. It exists only for backward compatibility, and should not be used for new work.

History 2

Tags: [Deprecated]

CFrame

TypeDefault
CoordinateFrame
This property is deprecated. It exists only for backward compatibility, and should not be used for new work.

History 2

Tags: [Deprecated]

CanCollide

TypeDefault
bool
This property is deprecated. It exists only for backward compatibility, and should not be used for new work.

History 2

Tags: [Deprecated]

CanShorelinesBeUpgraded

Parameters (0)
No parameters.
Returns (1)
bool

History 2

CancelImportHeightmap

Parameters (0)
No parameters.
Returns (1)
void

History 3

Clone

Parameters (0)
No parameters.
Returns (1)
Instance
This function is deprecated. It exists only for backward compatibility, and should not be used for new work.

History 2

Tags: [Deprecated]

Destroy

Parameters (0)
No parameters.
Returns (1)
void
This function is deprecated. It exists only for backward compatibility, and should not be used for new work.

History 2

Tags: [Deprecated]

Elasticity

TypeDefault
float
This property is deprecated. It exists only for backward compatibility, and should not be used for new work.

History 2

Tags: [Deprecated]

Friction

TypeDefault
float
This property is deprecated. It exists only for backward compatibility, and should not be used for new work.

History 2

Tags: [Deprecated]

GetBaseMaterialSlotIndex

Parameters (1)
baseMaterialMaterial
Returns (1)
int?

History 2

GetFirstCustomMaterialSlotIndex

Parameters (0)
No parameters.
Returns (1)
int

History 2

HideTerrainRegion

Parameters (0)
No parameters.
Returns (1)
void

History 2

ImportHeightMap

Parameters (3)
heightMapBinarystring
colorMapBinarystring
regionRegion3
Returns (1)
void
This function has a custom internal state. It may behave in a non-standard way.

History 2

Tags: [CustomLuaState]

ImportHeightmap

Parameters (4)
regionRegion3
heightmapAssetIdContent
colormapAssetIdContent
defaultMaterialMaterial
Returns (1)
void
This function yields. It will block the calling thread until completion.

History 3

Tags: [Yields]

Locked

TypeDefault
bool
This property is deprecated. It exists only for backward compatibility, and should not be used for new work.

History 2

Tags: [Deprecated]

MakeJoints

Parameters (0)
No parameters.
Returns (1)
void
This function is deprecated. It exists only for backward compatibility, and should not be used for new work.

History 2

Tags: [Deprecated]

Material

TypeDefault
Material
This property is deprecated. It exists only for backward compatibility, and should not be used for new work.

History 2

Tags: [Deprecated]

Name

TypeDefault
string
This property is deprecated. It exists only for backward compatibility, and should not be used for new work.

History 2

Tags: [Deprecated]

Position

TypeDefault
Vector3
This property is deprecated. It exists only for backward compatibility, and should not be used for new work.

History 2

Tags: [Deprecated]

Reflectance

TypeDefault
float
This property is deprecated. It exists only for backward compatibility, and should not be used for new work.

History 2

Tags: [Deprecated]

Resize

Parameters (2)
normalIdNormalId
deltaAmountint
Returns (1)
bool
This function is deprecated. It exists only for backward compatibility, and should not be used for new work.

History 2

Tags: [Deprecated]

RotVelocity

TypeDefault
Vector3
This property is deprecated. It exists only for backward compatibility, and should not be used for new work.

History 2

Tags: [Deprecated]

SetImportHeightmapPaused

Parameters (1)
pausedbool
Returns (1)
void

History 3

SetTerrainRegion

Parameters (2)
cframeCFrame
sizeVector3
Returns (1)
void

History 2

SetWireframeRegion

Parameters (2)
cframeCFrame
sizeVector3
Returns (1)
void

History 2

ShowTerrainRegion

Parameters (0)
No parameters.
Returns (1)
void

History 2

TerrainProgressUpdate

Parameters (1)
progressRatiofloat

History 3

Transparency

TypeDefault
float
This property is deprecated. It exists only for backward compatibility, and should not be used for new work.

History 2

Tags: [Deprecated]

Velocity

TypeDefault
Vector3
This property is deprecated. It exists only for backward compatibility, and should not be used for new work.

History 2

Tags: [Deprecated]

breakJoints

Parameters (0)
No parameters.
Returns (1)
void
This function is deprecated. It exists only for backward compatibility, and should not be used for new work.

History 2

Tags: [Deprecated]

clone

Parameters (0)
No parameters.
Returns (1)
Instance
This function is deprecated. It exists only for backward compatibility, and should not be used for new work.

History 2

Tags: [Deprecated]

destroy

Parameters (0)
No parameters.
Returns (1)
void
This function is deprecated. It exists only for backward compatibility, and should not be used for new work.

History 2

Tags: [Deprecated]

makeJoints

Parameters (0)
No parameters.
Returns (1)
void
This function is deprecated. It exists only for backward compatibility, and should not be used for new work.

History 2

Tags: [Deprecated]

resize

Parameters (2)
normalIdNormalId
deltaAmountint
Returns (1)
bool
This function is deprecated. It exists only for backward compatibility, and should not be used for new work.

History 2

Tags: [Deprecated]

Settings