GSmGpE6CwX2y9JjB25B8
We use cookies on this site to enhance your user experience
Collapse Sidebar

Terrain

Show Show deprecated

Terrain

Show deprecated

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

bool

IsSmooth

[ReadOnly] [NotReplicated] [Deprecated]

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

BinaryString

MaterialColors

[NotScriptable]

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

MaxExtents

[ReadOnly] [NotReplicated]

Displays the boundaries of the largest possible editable region.

Color3

WaterColor

The tint of the Terrain water.

float

WaterReflectance

Controls how opaque the Terrain’s water reflections are.

float

WaterTransparency

The transparency of the Terrain water.

float

WaterWaveSize

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

float

WaterWaveSpeed

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

Inherited from BasePart: Show Hide

bool

Anchored

Determines whether a part is immovable by physics

float

BackParamA

Determines the first parameter for the SurfaceType on the Back face of a part (-Z direction)

float

BackParamB

Determines the second parameter for the SurfaceType on the Back face of a part (-Z direction)

SurfaceType

BackSurface

Determines the type of surface for the Back face of a part (+Z direction)

InputType

BackSurfaceInput

Determines the kind of input for the Back face of a part (+Z direction)

float

BottomParamA

Determines the first parameter for the SurfaceType on the Bottom face of a part (-Y direction)

float

BottomParamB

Determines the second parameter for the SurfaceType on the Bottom face of a part (-Y direction)

SurfaceType

BottomSurface

Determines the type of surface for the Bottom face of a part (-Y direction)

InputType

BottomSurfaceInput

Determines the kind of input for the Bottom face of a part (-Y direction)

BrickColor

BrickColor

[NotReplicated]

Determines the color of a part.

CFrame

CFrame

Determines the position and rotation of a part in the world

bool

CanCollide

Determines whether a part may collide with other parts.

bool

CastShadow

Determines whether or not a part casts a shadow

Vector3

CenterOfMass

[ReadOnly] [NotReplicated]

Describes the world position in which a part’s center of mass is located.

int

CollisionGroupId

Describes the automatically-set ID number of a part’s collision group

Color3

Color

[NotReplicated]

Determines the color of a part.

PhysicalProperties

CustomPhysicalProperties

Determines several physical properties of a part

float

Elasticity

[Hidden] [NotReplicated] [Deprecated]

Used to control the Elasticity of the part, but it no longer does anything

float

Friction

[Hidden] [NotReplicated] [Deprecated]

Used to control the Friction of the part, but now it no longer does anything.

float

FrontParamA

Determines the first parameter for the SurfaceType on the Front face of a part (-Z direction)

float

FrontParamB

Determines the second parameter for the SurfaceType on the Front face of a part (-Z direction)

SurfaceType

FrontSurface

Determines the type of surface for the Front face of a part (-Z direction)

InputType

FrontSurfaceInput

Determines the kind of input for the Front face of a part (-Z direction)

float

LeftParamA

Determines the first parameter for the SurfaceType on the Left face of a part (-Z direction)

float

LeftParamB

Determines the second parameter for the SurfaceType on the Left face of a part (-Z direction)

SurfaceType

LeftSurface

Determines the type of surface for the Left face of a part (-X direction)

InputType

LeftSurfaceInput

Determines the kind of input for the Left face of a part (+X direction)

float

LocalTransparencyModifier

[Hidden] [NotReplicated]

Determines a multiplier for BasePart/Transparency that is only visible to the local client

bool

Locked

Determines whether a part is selectable in Studio.

bool

Massless

Determines whether the part contributes to the total mass or inertia of its rigid body

Material

Material

Determines the texture and default physical properties of a part

Vector3

Orientation

[NotReplicated]

Describes the position of the part in the world.

Vector3

Position

[NotReplicated]

Describes the position of the part in the world.

float

ReceiveAge

[Hidden] [ReadOnly] [NotReplicated]

Time since last recorded physics update

float

Reflectance

Determines how much a part reflects the skybox.

int

ResizeIncrement

[ReadOnly] [NotReplicated]

Describes the smallest change in size allowable by the Resize method

Faces

ResizeableFaces

[ReadOnly] [NotReplicated]

Describes the faces on which a part may be resized

float

RightParamA

Determines the first parameter for the SurfaceType on the Right face of a part (-X direction)

float

RightParamB

Determines the second parameter for the SurfaceType on the Right face of a part (-X direction)

SurfaceType

RightSurface

Determines the type of surface for the Right face of a part (+X direction)

InputType

RightSurfaceInput

Determines the kind of input for the Right face of a part (-X direction)

int

RootPriority

The main rule in determining the root part of an assembly

Vector3

RotVelocity

Determines a part’s change in orientation over time

Vector3

Rotation

[NotReplicated]

The rotation of the part in degrees for the three axes.

Vector3

Size

[NotReplicated]

Determines the dimensions of a part (length, width, height)

float

SpecificGravity

[ReadOnly] [NotReplicated] [Deprecated]

The ratio of the part’s density to the density of water determined by the BasePart/Material

float

TopParamA

Determines the first parameter for the SurfaceType on the Top face of a part (+Y direction)

float

TopParamB

Determines the second parameter for the SurfaceType on the Top face of a part (+Y direction)

SurfaceType

TopSurface

Determines the type of surface for the Top face of a part (+Y direction)

InputType

TopSurfaceInput

Determines the kind of input for the Top face of a part (+Y direction)

float

Transparency

Determines how much a part can be seen through (the inverse of part opacity)

Vector3

Velocity

Determines a part’s change in position over time

BrickColor

brickColor

[NotReplicated] [Deprecated]

Inherited from Instance: Show Hide

bool

Archivable

Determines if an Instance can be cloned using /Instance/Clone or saved to file.

string

ClassName

[ReadOnly] [NotReplicated]

A read-only string representing the class this Instance belongs to

int

DataCost

[ReadOnly] [NotReplicated] [Deprecated]

The cost of saving the instance using data persistence.

string

Name

A non-unique identifier of the Instance

Instance

Parent

Determines the hierarchical parent of the Instance

bool

RobloxLocked

If true, the Instance and its descendants cannot be indexed or edited by a Script or LocalScript and will throw an error if it is attempted

bool

archivable

[Hidden] [NotReplicated] [Deprecated]
string

className

[ReadOnly] [NotReplicated] [Deprecated]

Functions

bool

AutowedgeCell ( int x , int y , int z )

[Deprecated]

(OBSOLETE) No longer does anything.

void

AutowedgeCells ( Region3int16 region )

[Deprecated]

(OBSOLETE) No longer does anything.

Vector3

CellCenterToWorld ( int x , int y , int z )

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

Vector3

CellCornerToWorld ( int x , int y , int z )

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

void

Clear ( )

Clears the terrain.

void

ConvertToSmooth ( )

[Deprecated]

Transforms the legacy terrain engine into the new terrain engine.

Instance

CopyRegion ( Region3int16 region )

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

CountCells ( )

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

void

FillBall ( Vector3 center , float radius , Material material )

Fills a ball of smooth terrain in a given space.

void

FillBlock ( CFrame cframe , Vector3 size , Material material )

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

void

FillCylinder ( CFrame cframe , float height , float radius , Material material )

Fills a cylinder of smooth terrain in a given space.

void

FillRegion ( Region3 region , float resolution , Material material )

Fills a Region3 space with smooth terrain.

Tuple

GetCell ( int x , int y , int z )

[Deprecated]

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

Color3

GetMaterialColor ( Material material )

Returns current terrain material color for specified terrain material.

Tuple

GetWaterCell ( int x , int y , int z )

[Deprecated]

Returns if the cell is a water cell.

void

PasteRegion ( Instance region , Vector3int16 corner , bool pasteEmptyCells )

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

Tuple

ReadVoxels ( Region3 region , float resolution )

[CustomLuaState]

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

void

ReplaceMaterial ( Region3 region , float resolution , Material sourceMaterial , Material targetMaterial )

void

SetCell ( int x , int y , int z , CellMaterial material , CellBlock block , CellOrientation orientation )

[Deprecated]

Sets the occupancy and material of a specific terrain voxel.

void

SetCells ( Region3int16 region , CellMaterial material , CellBlock block , CellOrientation orientation )

[Deprecated]

Sets the occupancy and material of all terrain voxels in a specific region.

void

SetMaterialColor ( Material material , Color3 value )

Sets current terrain material color for specified terrain material.

void

SetWaterCell ( int x , int y , int z , WaterForce force , WaterDirection direction )

[Deprecated]

Sets the specified terrain voxel’s material to ‘‘Water’’ and sets its occupancy to 1.

Vector3

WorldToCell ( Vector3 position )

Returns the grid cell location that contains the point position.

Vector3

WorldToCellPreferEmpty ( Vector3 position )

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

Vector3

WorldToCellPreferSolid ( Vector3 position )

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

void

WriteVoxels ( Region3 region , float resolution , Array materials , Array occupancy )

[CustomLuaState]

Sets a certain region of smooth terrain using the table format

Inherited from BasePart: Show Hide

void

BreakJoints ( )

Breaks any surface connection with any adjacent part, including Weld and other JointInstance.

bool

CanCollideWith ( Instance part )

Returns whether the parts can collide with each other.

Tuple

CanSetNetworkOwnership ( )

Checks whether you can set a BasePart|part's network ownership

Objects

GetConnectedParts ( bool recursive )

Returns a table of parts connected to the the object by any kind of rigid joint.

Objects

GetJoints ( )

Return all Joints or Constraints that is connected to this Part.

float

GetMass ( )

[CustomLuaState]

Returns the part’s mass based on the part’s material and size

Instance

GetNetworkOwner ( )

Returns the current player who is the network owner of this part, or nil in case of the server.

bool

GetNetworkOwnershipAuto ( )

Returns true if the game engine automatically decides the network owner for this part.

CFrame

GetRenderCFrame ( )

[Deprecated]

(OBSOLETE) Returns a CFrame describing where the part is being rendered at

Instance

GetRootPart ( )

Returns the base part of an assembly of parts.

Objects

GetTouchingParts ( )

Returns a table of all CanCollide true parts that intersect with this part.

bool

IsGrounded ( )

Returns true if the object is connected to a part that will hold it in place (eg an BasePart/Anchored part), otherwise returns false.

void

MakeJoints ( )

Creates a joint on any side of the object that has a surface ID that can make a joint.

bool

Resize ( NormalId normalId , int deltaAmount )

Changes the size of an object just like using the Studio resize tool.

void

SetNetworkOwner ( Instance playerInstance )

Sets the given player as network owner for this and all connected parts

void

SetNetworkOwnershipAuto ( )

Lets the game engine dynamically decide who will handle the part’s physics (one of the clients or the server).

Instance

UnionAsync ( Objects parts , CollisionFidelity collisionfidelity , RenderFidelity renderFidelity )

[Yields]

Performs a Union operation on the calling BasePart and the list of parts passed in as the first parameter

void

breakJoints ( )

[Deprecated]
float

getMass ( )

[Deprecated] [CustomLuaState]
void

makeJoints ( )

[Deprecated]
bool

resize ( NormalId normalId , int deltaAmount )

[Deprecated]

Inherited from Instance: Show Hide

void

ClearAllChildren ( )

This function destroys all of an Instance's children.

Instance

Clone ( )

Create a deep copy of a Roblox instance and descendants where Archivable = true.

void

Destroy ( )

Sets the Instance/Parent property to nil, locks the Instance/Parent property, disconnects all connections and calls Destroy on all children.

Instance

FindFirstAncestor ( string name )

Returns the first ancestor of the Instance whose Instance/Name is equal to the given name.

Instance

FindFirstAncestorOfClass ( string className )

Returns the first ancestor of the Instance whose Instance/ClassName is equal to the given className.

Instance

FindFirstAncestorWhichIsA ( string className )

Returns the first ancestor of the Instance for whom Instance/IsA returns true for the given className.

Instance

FindFirstChild ( string name , bool recursive )

Returns the first child of the Instance found with the given name.

Instance

FindFirstChildOfClass ( string className )

Returns the first child of the Instance whose Instance/ClassName|ClassName is equal to the given className.

Instance

FindFirstChildWhichIsA ( string className , bool recursive )

Returns the first child of the Instance for whom Instance/IsA returns true for the given className.

Objects

GetChildren ( )

Returns an array containing all of the Instance's children.

string

GetDebugId ( int scopeLength )

[NotBrowsable]

Returns a coded string of the Instances DebugId used internally by Roblox.

Array

GetDescendants ( )

[CustomLuaState]

Returns an array containing all of the descendants of the instance

string

GetFullName ( )

Returns a string describing the Instance's ancestry.

RBXScriptSignal

GetPropertyChangedSignal ( string property )

Get an event that fires when a given property of an object changes.

bool

IsA ( string className )

[CustomLuaState]

Returns true if an Instance's class matches or inherits from a given class

bool

IsAncestorOf ( Instance descendant )

Returns true if an Instance is an ancestor of the given descendant.

bool

IsDescendantOf ( Instance ancestor )

Returns true if an Instance is a descendant of the given ancestor.

void

Remove ( )

[Deprecated]

Sets the object’s Parent to nil, and does the same for all its descendants.

Instance

WaitForChild ( string childName , double timeOut )

[CustomLuaState] [CanYield]

Returns the child of the Instance with the given name. If the child does not exist, it will yield the current thread until it does.

Objects

children ( )

[Deprecated]

Returns an array of the object’s children.

Instance

clone ( )

[Deprecated]
void

destroy ( )

[Deprecated]
Instance

findFirstChild ( string name , bool recursive )

[Deprecated]
Objects

getChildren ( )

[Deprecated]
bool

isA ( string className )

[Deprecated] [CustomLuaState]
bool

isDescendantOf ( Instance ancestor )

[Deprecated]
void

remove ( )

[Deprecated]

Events

Inherited from BasePart: Show Hide

RBXScriptSignal

LocalSimulationTouched ( Instance part )

[Deprecated]

.

RBXScriptSignal

OutfitChanged ( )

[Deprecated]

.

RBXScriptSignal

StoppedTouching ( Instance otherPart )

[Deprecated]

.

RBXScriptSignal

TouchEnded ( Instance otherPart )

Fired when a part stops touching another part.

RBXScriptSignal

Touched ( Instance otherPart )

Fired when a part comes in contact with another part

RBXScriptSignal

touched ( Instance otherPart )

[Deprecated]

Inherited from Instance: Show Hide

RBXScriptSignal

AncestryChanged ( Instance child , Instance parent )

Fires when the Instance/Parent property of the object or one of its ancestors is changed.

RBXScriptSignal

Changed ( string property )

Fired immediately after a property of an object changes.

RBXScriptSignal

ChildAdded ( Instance child )

Fires when an object is parented to this Instance.

RBXScriptSignal

ChildRemoved ( Instance child )

Fires when a child is removed from this Instance.

RBXScriptSignal

DescendantAdded ( Instance descendant )

Fires when a descendant is added to the Instance

RBXScriptSignal

DescendantRemoving ( Instance descendant )

Fires immediately before a descendant of the Instance is removed.

RBXScriptSignal

childAdded ( Instance child )

[Deprecated]