Roblox UtilitiesDevlHub Roblox Documentation

Class

Decal

Inherits
FaceInstance › Instance › Object
Memory category
GraphicsTexture
Subclasses
1

Applies an image texture to a face of a parent BasePart.

The Decal object applies an image texture to a face of a parent BasePart. The affected face is dependent on the Face property, and the size of the decal is dependent on the size of the face.

The applied image texture is determined by its ColorMapContent property. For details on how to upload images, see asset management.

For more information, review textures and decals. See also:

Properties 21#

AutoLocalizebooleanWhen set to true, the decal's image asset is eligible for automatic localization capture.ReadSafe
Color3Color3The Color3 tint of the Decal.ReadSafe
ColorMapContentIdContent ID that determines the color and opacity of the surface.ReadSafeNotReplicated
ColorMapContentContentContent object that determines the color and opacity of the surface.ReadSafeNotReplicated
LocalTransparencyModifierfloatActs as a multiplier for the decal's Transparency property. The effects are only visible to the local player.ReadSafeHiddenNotReplicated
MetalnessMapContentIdContent ID that determines the metalness map of the surface.Read: PluginSecurityWrite: PluginSecurityReadSafeHidden
MetalnessMapContentContentContent object that determines the metalness map of the surface.Write: PluginSecurityReadSafe
NormalMapContentIdContent ID that determines the normal map of the surface.Read: PluginSecurityWrite: PluginSecurityReadSafeHidden
NormalMapContentContentContent object that determines the normal map of the surface.Write: PluginSecurityReadSafe
RotationfloatRotates the decal texture.ReadSafe
RoughnessMapContentIdContent ID that determines the roughness map of the surface.Read: PluginSecurityWrite: PluginSecurityReadSafeHidden
RoughnessMapContentContentContent object that determines the roughness map of the surface.Write: PluginSecurityReadSafe
ShinyfloatDeprecated property that previously set the shininess of the decal.ReadSafeDeprecatedNotReplicated
SpecularfloatDeprecated property that previously set the specularity of the decal.ReadSafeDeprecatedNotReplicated
TextureContentIdThe content ID of the image to be applied by the Decal.ReadSafeDeprecated
TextureContentContentThe texture content displayed by the Decal.ReadSafeDeprecated
TexturePackContentContentEngine-managed Content that stores the compressed runtime texture-pack data for PBR decals.Read: RobloxEngineSecurityWrite: RobloxEngineSecurityReadSafe
TransparencyfloatDetermines the transparency of the Decal.ReadSafe
UVOffsetVector2Shifts the UV coordinates by adding an offset before texture mapping.ReadSafe
UVScaleVector2Stretches or compresses the UV coordinates by multiplying a scale factor.ReadSafe
ZIndexintDetermines the rendering order when multiple decals are assigned the same face.ReadSafe

AutoLocalize: boolean#

ReadSafe

When set to true, the decal's image asset is eligible for automatic localization through the Automatic Asset Capture system. The LocalizationService uses this property to determine whether the decal's ColorMapContent should be captured and potentially replaced with a localized version.

This property only applies to non-PBR decals. If any PBR maps (NormalMapContent, RoughnessMapContent, or MetalnessMapContent) are set, automatic localization capture is suppressed to avoid inconsistent rendering.

Color3: Color3#

ReadSafe

The Color3 tint of the Decal. Note that this property only sets the tint of the decal rather than the color; unless the image associated with the Decal was originally pure white, then the color cannot be freely changed using this property.

ColorMap: ContentId#

NotReplicatedReadSafe

This property takes a content ID to determine the color and opacity of the surface. This texture is sometimes called the albedo texture.

ColorMapContent: Content#

NotReplicatedReadSafe

This property takes a Content object to determine the color and opacity of the surface. This texture is sometimes called the albedo texture.

LocalTransparencyModifier: float#

HiddenNotReplicatedReadSafe

Acts as a multiplier for the decal's Transparency property. The effect is only visible to the LocalPlayer and will not replicate to the server.

When this property is set to 1, the Decal will be completely invisible regardless of its original transparency. When it is set to 0, the decal's rendered transparency will match the Transparency value.

MetalnessMap: ContentId#

HiddenRead: PluginSecurityWrite: PluginSecurityReadSafe

This property takes a content ID that determines the metalness map applied to the surface. A metalness map controls how metallic the surface appears at each point, blending between a dielectric (non-metal) and a metallic response to light. It defaults to an empty content, in which case no metalness map is applied.

Assigning a normal, roughness, or metalness map makes the Decal a physically based rendering (PBR) surface. To assign this map from a Content object, use MetalnessMapContent.

MetalnessMapContent: Content#

Write: PluginSecurityReadSafe

This property takes a Content object that determines the metalness map applied to the surface. A metalness map controls how metallic the surface appears at each point, blending between a dielectric (non-metal) and a metallic response to light. It defaults to an empty content, in which case no metalness map is applied.

Assigning a normal, roughness, or metalness map makes the Decal a physically based rendering (PBR) surface.

NormalMap: ContentId#

HiddenRead: PluginSecurityWrite: PluginSecurityReadSafe

This property takes a content ID that determines the normal map applied to the surface. A normal map perturbs the surface normals used in lighting calculations, adding the appearance of fine detail such as bumps and grooves without changing the underlying geometry. It defaults to an empty content, in which case no normal map is applied.

Assigning a normal, roughness, or metalness map makes the Decal a physically based rendering (PBR) surface. To assign this map from a Content object, use NormalMapContent.

NormalMapContent: Content#

Write: PluginSecurityReadSafe

This property takes a Content object that determines the normal map applied to the surface. A normal map perturbs the surface normals used in lighting calculations, adding the appearance of fine detail such as bumps and grooves without changing the underlying geometry. It defaults to an empty content, in which case no normal map is applied.

Assigning a normal, roughness, or metalness map makes the Decal a physically based rendering (PBR) surface.

Rotation: float#

ReadSafe

This property controls the rotation angle of the decal texture in degrees. Rotation is applied to the UV coordinates in the clockwise direction.

RoughnessMap: ContentId#

HiddenRead: PluginSecurityWrite: PluginSecurityReadSafe

This property takes a content ID that determines the roughness map applied to the surface. A roughness map controls how rough or smooth the surface appears at each point, which in turn determines how sharp or blurry its reflections are. It defaults to an empty content, in which case no roughness map is applied.

Assigning a normal, roughness, or metalness map makes the Decal a physically based rendering (PBR) surface. To assign this map from a Content object, use RoughnessMapContent.

RoughnessMapContent: Content#

Write: PluginSecurityReadSafe

This property takes a Content object that determines the roughness map applied to the surface. A roughness map controls how rough or smooth the surface appears at each point, which in turn determines how sharp or blurry its reflections are. It defaults to an empty content, in which case no roughness map is applied.

Assigning a normal, roughness, or metalness map makes the Decal a physically based rendering (PBR) surface.

Shiny: float#

NotReplicatedDeprecatedReadSafeDeprecated

Deprecated. This non-functional property is deprecated and should not be used in new work.

This property dictates how shiny the decal is. It takes a value between 0 and 1, where 1 is "fully shiny."

Specular: float#

NotReplicatedDeprecatedReadSafeDeprecated

Deprecated. This property no longer functions correctly and is deprecated. It should not be used in new work.

Sets the specularity, which is how the surface responds to light being shined on it.

Texture: ContentId#

ReadSafeDeprecated

Deprecated. This property has been deprecated. Use ColorMapContent for future work.

The content ID of the image to be applied by the Decal.

TextureContent: Content#

ReadSafeDeprecated

Deprecated. This property has been deprecated. Use ColorMapContent for future work.

The texture content displayed by the Decal. Supports asset URIs and EditableImage objects.

TexturePackContent: Content#

Read: RobloxEngineSecurityWrite: RobloxEngineSecurityReadSafe

Managed by the engine and not accessible from scripts. A Content that holds the decal's compressed runtime texture data. When the Decal is a physically based rendering (PBR) surface, the engine packs its color, normal, roughness, and metalness maps into a single texture-pack asset and references it here. Defaults to an empty content.

Transparency: float#

ReadSafe

Determines the transparency of the Decal with 0 being completely opaque and 1 completely transparent.

Note that LocalTransparencyModifier acts as a multiplier for this transparency level and should be used when the transparency of the decal is likely to be changed by another script.

UVOffset: Vector2#

ReadSafe

This property controls the UV coordinate translation. The X value (U offset) and Y value (V offset) are added to every corresponding UV coordinate during texture mapping.

UVScale: Vector2#

ReadSafe

This property controls the scale applied to the horizontal and vertical coordinates. The X value (U scale) and Y value (V scale) are multiplied by every corresponding UV coordinate during texture mapping.

ZIndex: int#

ReadSafe

This property determines the order in which decals on the same Face of a BasePart are rendered. Lower values are rendered first, so a decal with a higher ZIndex renders on top of those with a lower ZIndex.

If you're unsure whether you'll need to layer a decal between two already-existing decals in the future, use larger separations between ZIndex values such as 10 or 100 to ensure space for future decals between.

Inherited members#

Inherited from FaceInstance 1
Properties (1)

Face

Inherited from Instance 58
Inherited from Object 6
Properties (2)

ClassName, className

Events (1)

Changed

Subclasses 1#