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.
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.
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.
IT didnt work!
Did VertexColor not change, or did the change have no effect? Those are two different things.
Well without the script the mesh was yellow, and I put in the vertex color to blue yet it is still yellow.
Did the property change, though? It doesn't always work.
It worked
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.
1 comment
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