Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to Change a VertexColor of a Mesh in Lua?

How might I change a VertexColor of a Mesh in Lua? My variable is named mesh. I tried this: mesh.VertexColor = (0,0,1)

But it didn't work.

1 comment

0

VertexColor is a Vector3 color value. This means you need to define the VertexColor with Color3.new() and the RGB colors from 0 to 1. Such as 100/255 or .9

1 answer

Like M39a9am3R said, VertexColor is a Vector3 value, and must be assigned like so:

mesh.VertextColor = Vector3.new(0, 0, 1)


Note that Color3s and Vector3s are fundamentally the exact same thing, they just have slightly different methods and applications. Meshes predate Color3, which is why they use Vector3 instead.

6 comments

0

IT didnt work!

0

Did VertexColor not change, or did the change have no effect? Those are two different things.

0

Well without the script the mesh was yellow, and I put in the vertex color to blue yet it is still yellow.

0

Did the property change, though? It doesn't always work.

0

It worked

0

If the property changed but the mesh didn't change color - there's nothing you can do, that's a ROBLOX bug.

This discussion is preserved as it was. New answers, comments, and votes are closed.