How to add manual generated color ?
Mesh mesh = new Mesh();
mesh.vertices = vertices.ToArray();
mesh.triangles = triangles.ToArray();
mesh.colors = colors.ToArray();
bubbles.GetComponent<MeshFilter>().sharedMesh = mesh;
bubbles.GetComponent<SkinnedMeshRenderer>().sharedMesh = mesh;
bubbles.GetComponent<SkinnedMeshRenderer>().sharedMaterial = bubblesMat;
I received all those data(including all of the coordinates to generate the object.) from text except the bubblesMat which I receive it from inspector. Now, the only material that I can use for bubblesMat is Sprites-Default material which is provided by Unity because if I use other material the color that I generated will disappear. By using the Sprites-Default material, it makes the shape of the object looks weird because it's 2D.
Is there any way to apply the manual generated color to the material or to the object?
did you tried GetComponent().material = thematerialyouwant
Your answer
Follow this Question
Related Questions
Helppp meee about making Cube... Urgent... 1 Answer
Hiding part of mesh 0 Answers
Image ontop of a mesh with color 0 Answers
Can someone please help me with mesh extrusion 0 Answers
How do i use lines to calculate triangles on mesh?? 0 Answers