PcoWSkbVqDnWTu_dm2ix
Collapse Sidebar

VertexColor

DataModelMesh

Vector3

VertexColor determines the huge change of the FileMesh/TextureId|Texture of a FileMesh.

The image below shows two versions of the hat “Ozzy’s Formal Top Hat”. The left has a default VertexColor of (1, 1, 1), or white. The right has a VertexColor of (0, 0, 1), or blue. The RGB colors on the texture of the red and white hat are multiplied with that of the VertexColor’s XYZ components.

It should be noted that this property is a datatype/Vector3 rather than a datatype/Color3. To convert, use the following function:

local function color3ToVector3(c3)
   return Vector3.new(c3.r, c3.g, c3.b)
end

Although this property allows basic modification of a texture, changing a texture entirely provides more control. See MeshPart for more details.


Code Samples


Mesh VertexColor

In this code sample a BasePart is instanced with a SpecialMesh. The DataModelMesh/VertexColor property of the SpecialMesh is then animated using TweenService.