We use cookies on this site to enhance your user experience

Terrain

Terrain

Terrain is a feature that allows players to create dynamically morphable environments, with little to no lag. Terrain is currently based on a 4x4x4 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. Terrain provides a practically unlimited amount of space to work with.

Properties

Name Type Description
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

Region3int16

Displays the boundaries of the largest possible editable region.

Color3

The tint of the Terrain water.

float

Controls how opaque the Terrain’s water reflections are.

float

The transparency of the Terrain water.

float

Sets the maximum height of the Terrain water waves in studs.

float

Sets how many times the Terrain water waves will move up and down per minute.

Inherited from Instance , PVInstance , BasePart

Archivable ClassName DataCost Name Parent RobloxLocked Anchored BackParamA BackParamB BackSurface BackSurfaceInput BottomParamA BottomParamB BottomSurface BottomSurfaceInput BrickColor CFrame CanCollide CenterOfMass CollisionGroupId Color CustomPhysicalProperties FrontParamA FrontParamB FrontSurface FrontSurfaceInput LeftParamA LeftParamB LeftSurface LeftSurfaceInput LocalTransparencyModifier Locked Material Orientation Position ReceiveAge Reflectance ResizeIncrement ResizeableFaces RightParamA RightParamB RightSurface RightSurfaceInput RotVelocity Rotation Size TopParamA TopParamB TopSurface TopSurfaceInput Transparency Velocity

Functions

Name Type Description
Vector3

Returns the world position of the center of the terrain cell (x, y, z).

Vector3

Returns the position of the lower-left-forward corner of the grid cell (x, y, z).

void

Clears the terrain.

Instance

Stores a chunk of terrain into a TerrainRegion object so it can be loaded back later. Note: TerrainRegion data does not replicate between server and client.

int

Returns the number of non-empty cells in the Terrain.

void

Fills a ball of smooth terrain in a given space.

void

Fills a block of smooth terrain with a given location, rotation, size, and material.

void

Fills a Region3 space with smooth terrain.

Color3

Returns current terrain material color for specified terrain material.

void

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

Tuple

Returns a certain region of smooth terrain in table format. Both of the return arrays have an additional .Size property, a Vector3.

void

Sets current terrain material color for specified terrain material.

Vector3

Returns the grid cell location that contains the point position.

Vector3

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

Vector3

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

void

Sets a certain region of smooth terrain using the table format

Inherited from Instance , PVInstance , BasePart

ClearAllChildren Clone Destroy FindFirstAncestor FindFirstAncestorOfClass FindFirstAncestorWhichIsA FindFirstChild FindFirstChildOfClass FindFirstChildWhichIsA GetChildren GetDebugId GetDescendants GetFullName GetPropertyChangedSignal IsA IsAncestorOf IsDescendantOf WaitForChild BreakJoints CanCollideWith CanSetNetworkOwnership GetConnectedParts GetJoints GetMass GetNetworkOwner GetNetworkOwnershipAuto GetRootPart GetTouchingParts IsGrounded MakeJoints Negate Resize Separate SetNetworkOwner SetNetworkOwnershipAuto UnionWith