Hi, me again =]
Just wondering what i may be doing wrong while attempting to change the color values of a vertex inside a mesh…
At the moment i have it doing the following…
var vertices = mesh.vertices;
var normals = mesh.normals;
var sqrRadius = inRadius * inRadius;
var colours = mesh.colors;
for(var i=0;i<vertices.length;i++)
{
//getting the vertices around the local point passed
var sqrMagnitude = (vertices[i] - position).sqrMagnitude;
//if the vertex is too far away, dont carry on
if (sqrMagnitude > sqrRadius)
continue;
print("Vertex: " + vertices[i] + " - " + i );
//set the alpha to 0
colours[i].a = 0;
}
mesh.colors = colours;
So i pass a position vector3 into the function which is essentially a point on the plane. It takes that and changes the vertex color alpha value to 0 to make it invisible.
However it doesn’t do anything. I’ve even tried changing the other rgb values. I’ve also tried this on the Start() function to just change random vertices to different colours, but nothing happens. Is there something in need to change on the mesh itself? Does it need to have a special kind of material attached to it or something?
thanks!