MaterialService

Show Deprecated
Not Creatable
Service

MaterialService is the game service responsible for managing materials. It is the container for global MaterialVariant instances. MaterialVariant can be child or descendant of MaterialService. For each base Material type, MaterialService internally keeps a set of MaterialVariant references. MaterialVariant.Name is the key to access it. The MaterialVariant.Name and MaterialVariant.BaseMaterial are combined to work as an identifier. If more than one MaterialVariant object has the same name and BaseMaterial under MaterialService, only one of them can be used.

MaterialService has some (Material)Name properties. Assigning a MaterialVariant Name replaces the built-in material with the specified MaterialVariant. If the MaterialService can't find a matching MaterialVariant, it falls back to built-in material. Note BaseMaterial should also match, for example, a MaterialVariant with BaseMaterial Grass can only be assigned to MaterialService.GrassName, not AsphaltName or any other names. These properties are not scriptable but can read and write using MaterialService:GetBaseMaterialOverride() and MaterialService:SetBaseMaterialOverride() function.

MaterialService has a MaterialService.Use2022Materials property that switches between legacy materials and new materials introduced in year 2022. Because legacy and user-generated (new) terrain materials use different encoding, using legacy terrain materials and MaterialVariant at the same time has a performance penalty. If your game is using pre-2022 terrain materials, avoid overriding any built-in materials. Migrate to 2022 materials if possible.

Summary

Properties

Methods

Properties

AsphaltName

Not Scriptable
Roblox Security
Read Parallel

BasaltName

Not Scriptable
Roblox Security
Read Parallel

BrickName

Not Scriptable
Roblox Security
Read Parallel

CardboardName

Not Scriptable
Roblox Security
Read Parallel

CarpetName

Not Scriptable
Roblox Security
Read Parallel

CeramicTilesName

Not Scriptable
Roblox Security
Read Parallel

ClayRoofTilesName

Not Scriptable
Roblox Security
Read Parallel

CobblestoneName

Not Scriptable
Roblox Security
Read Parallel

ConcreteName

Not Scriptable
Roblox Security
Read Parallel

CorrodedMetalName

Not Scriptable
Roblox Security
Read Parallel

CrackedLavaName

Not Scriptable
Roblox Security
Read Parallel

DiamondPlateName

Not Scriptable
Roblox Security
Read Parallel

FabricName

Not Scriptable
Roblox Security
Read Parallel

FoilName

Not Scriptable
Roblox Security
Read Parallel

GlacierName

Not Scriptable
Roblox Security
Read Parallel

GraniteName

Not Scriptable
Roblox Security
Read Parallel

GrassName

Not Scriptable
Roblox Security
Read Parallel

GroundName

Not Scriptable
Roblox Security
Read Parallel

IceName

Not Scriptable
Roblox Security
Read Parallel

LeafyGrassName

Not Scriptable
Roblox Security
Read Parallel

LeatherName

Not Scriptable
Roblox Security
Read Parallel

LimestoneName

Not Scriptable
Roblox Security
Read Parallel

MarbleName

Not Scriptable
Roblox Security
Read Parallel

MetalName

Not Scriptable
Roblox Security
Read Parallel

MudName

Not Scriptable
Roblox Security
Read Parallel

PavementName

Not Scriptable
Roblox Security
Read Parallel

PebbleName

Not Scriptable
Roblox Security
Read Parallel

PlasterName

Not Scriptable
Roblox Security
Read Parallel

PlasticName

Not Scriptable
Roblox Security
Read Parallel

RockName

Not Scriptable
Roblox Security
Read Parallel

RoofShinglesName

Not Scriptable
Roblox Security
Read Parallel

RubberName

Not Scriptable
Roblox Security
Read Parallel

SaltName

Not Scriptable
Roblox Security
Read Parallel

SandName

Not Scriptable
Roblox Security
Read Parallel

SandstoneName

Not Scriptable
Roblox Security
Read Parallel

SlateName

Not Scriptable
Roblox Security
Read Parallel

SmoothPlasticName

Not Scriptable
Roblox Security
Read Parallel

SnowName

Not Scriptable
Roblox Security
Read Parallel

Use2022Materials

Not Replicated
Roblox Script Security
Read Parallel

WoodName

Not Scriptable
Roblox Security
Read Parallel

WoodPlanksName

Not Scriptable
Roblox Security
Read Parallel

Methods

GetBaseMaterialOverride

Parameters

material: Enum.Material

Returns

GetMaterialVariant

Parameters

material: Enum.Material
name: string

Returns

SetBaseMaterialOverride

()

Parameters

material: Enum.Material
name: string

Returns

()

Events