MaterialService

MaterialService : Instance

Overview

The MaterialService class is a game service that allows developers to manage and customize materials used in their games. It serves as the container for MaterialVariant instances, which are custom versions of Roblox's built-in materials. Using MaterialService, developers can globally override default materials or apply custom materials to specific parts or terrain, enabling unique visual styles and enhanced realism.

Description

The MaterialService class provides a centralized system for managing materials. By leveraging MaterialVariants, creators can redefine the appearance of base materials.

Properties

BasicName

string

Name of the MaterialVariant to replace the built-in Basic material

Code Samples

//NotWork//

BrickName

string

Name of the MaterialVariant to replace the built-in Brick material

Code Samples

//NotWork//

MetalName

string

Name of the MaterialVariant to replace the built-in Basic material

Code Samples

//NotWork//

PlasticName

string

Name of the MaterialVariant to replace the built-in Metal material

Code Samples

//NotWork//

RockName

string

Name of the MaterialVariant to replace the built-in Rock material

Code Samples

//NotWork//

UnlitName

string

Name of the MaterialVariant to replace the built-in Unli material

Code Samples

//NotWork//

BarkName

string

Name of the MaterialVariant to replace the built-in Bark material

Code Samples

//NotWork//

SmallBrickName

string

Name of the MaterialVariant to replace the built-in SmallBrick material

Code Samples

//NotWork//

LeafyGroundName

string

Name of the MaterialVariant to replace the built-in LeafyGround material

Code Samples

//NotWork//

MossyGroundName

string

Name of the MaterialVariant to replace the built-in MossyGround material

Code Samples

//NotWork//

GroundName

string

Name of the MaterialVariant to replace the built-in Ground material

Code Samples

//NotWork//

GlassName

string

Name of the MaterialVariant to replace the built-in Glass material

Code Samples

//NotWork//

PavementName

string

Name of the MaterialVariant to replace the built-in Pavement material

Code Samples

//NotWork//

MossyRockName

string

Name of the MaterialVariant to replace the built-in MossyRock material

Code Samples

//NotWork//

WoodPlanksName

string

Name of the MaterialVariant to replace the built-in WoodPlanks material

Code Samples

//NotWork//

WoodName

string

Name of the MaterialVariant to replace the built-in Woodmaterial

Code Samples

//NotWork//

Methods

GetBaseMaterialOverride

Gets the MaterialVariant name of the overridden material.

Parameters

Enum.Material InMaterial

Return

string

Code Samples

local MaterialService = game:GetService("MaterialService")

local VariantName = MaterialService:GetBaseMaterialOverride(Enum.Material.Plastic)
print(VariantName)

GetMaterialVariant

Retrieves the MaterialVariant associated with the given material and name.

Parameters

Enum.Material InMaterial

The material to associate the variant with.

string InName

The name of the MaterialVariant to retrieve.

Return

MaterialVariant

Code Samples

//NotWork//

SetBaseMaterialOverride

Sets the base material override with a given material and name using parameters: an Enum.Material (InMaterial).

Parameters

Enum.Material InMaterial

string InName

Return

void

Code Samples

//NotWork//

Events