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

BrickName

string

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

Code Samples

MetalName

string

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

Code Samples

PlasticName

string

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

Code Samples

RockName

string

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

Code Samples

UnlitName

string

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

Code Samples

BarkName

string

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

Code Samples

SmallBrickName

string

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

Code Samples

LeafyGroundName

string

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

Code Samples

MossyGroundName

string

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

Code Samples

GroundName

string

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

Code Samples

GlassName

string

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

Code Samples

PavementName

string

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

Code Samples

MossyRockName

string

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

Code Samples

WoodPlanksName

string

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

Code Samples

WoodName

string

Name of the MaterialVariant to replace the built-in Woodmaterial

Code Samples

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

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

Events

Last updated